DBGRID要有DataSet的,DBGRID只是个数据显示的控件,直接由Query/Table决定的!

解决方案 »

  1.   

    用一个table1、datasource1、dbgrid1dbgrid1.datasource:=datasource1;
    datasource1.dataset:=table1;
    如果你的table1里设置了databasename和tablename然后active设为true就可以
      

  2.   

    用一个table1、datasource1、dbgrid1
    dbgrid1.datasource:=datasource1;
    datasource1.dataset:=table1;
    如果你的table1里设置了databasename和tablename然后active设为true就可以
    ====================================================================
    对以上方法提出一点意见:既然人家要求是空白的dbgrid,使用楼上的方法是办不到的.最好是创建一个在内存中临时表,输入的数据都保存到临时表中.
      

  3.   

    创建一个临时表,dbgrid连在它上面,然后从你那个表里读一条记录,往临时表写条记录,然后临时表refresh一下就可以。
      

  4.   

    DBGrid的属性dataSource设置
    dataSource 属性 dataset