系统问题一大堆,已经删除了好多功能了  这个星期天就要上交了  各位帮帮忙啊!我有一个DBGrid 连的是access中的a表 DBGrid是可编辑的 。旁边方一个button的按钮,点击的时候把DBGrid中的数据更新到access的a表!请问这个该怎么实现????请给代码。还有一个问题 我在转换access到excel的时候老是出现说access violation at address 000000的错误。我的代码这些都没有问题啊!!!郁闷死了各位帮忙那  我把全部的分都给了

解决方案 »

  1.   

    procedure Tmain_1.BitBtn6Click(Sender: TObject);
    begin
          if opendialog1.Execute then
        excel.Text:=opendialog1.FileName;
    end;procedure Tmain_1.BitBtn7Click(Sender: TObject);
    begin
         if opendialog2.Execute then
        access.Text:=opendialog2.FileName;
    end;procedure Tmain_1.Button2Click(Sender: TObject);
    var
      SQLstr:string;
    begin
      if ((Excel.Text<>'')and(Access.Text<>'')and(e.Text<>'')and(a.Text<>'')) then
      begin
        adoconnection1.Connected:=false;
        ADOConnection1.ConnectionString:=
        'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+access.Text+';'
        +'Persist Security Info=False';
        SQLStr:='select * into '+a.Text+' FROM [excel 8.0;database='+excel.Text+'].['+e.Text+'$]';
        ADOConnection1.Execute(SQLStr);
        adoconnection1.Connected:=true;
        showmessage('数据转换成功!');
      end
    else
      begin
        showmessage('请输入完整数据!');
      end;
    end;
      

  2.   

    我有一个DBGrid 连的是access中的a表 DBGrid是可编辑的 。旁边方一个button的按钮,点击的时候把DBGrid中的数据更新到access的a表!请问这个该怎么实现????请给代码。这个问题已经解决 只要把连接adoquery1的autocalcfields的属性设为false  然后在post一下就可以了  这么简单的问题啊  我怎么没想到呢 还有第二个 谁帮帮忙啊
      

  3.   

    adoconnection1.Connected = True
    成功后才能
    ADOConnection1.Execute(SQLStr)
      

  4.   

    还有一个问题 我在转换access到excel的时候老是出现说access violation at address 000000的错误。我的代码这些都没有问题啊!!!郁闷死了
    ---------------------------------------------------皮肤控件的问题  移除了就好了  kao
      

  5.   

    你也可以把access的數據顯示到DBGrid中,然後通過DBGrid導成excel!!!