是接到用database desktop中设计的.db表格

解决方案 »

  1.   

    TADOConnection.TADOQuery.接上後,直接寫SQL語句
      

  2.   

    TADOConnection.TADOQuery.接上後,直接寫SQL語句
      

  3.   

    很方便用。 ADOConnection.ADOQuery.上+SQL語句
      

  4.   

    procedure Thjf.Button2Click(Sender: TObject);
    begin
        if (edit1.Text='') then
          begin
            showmessage('数据输入不完全,请输入完全再试');
            exit;
          end;
        try
          with ADODataSet1 do
             begin
              Active:=false;
              ConnectionString:=main.cnnstr;
              CommandText:='select * from hj';
              Active:=true;
              Insert;//插入模式
          edit; //编辑模式,也可添加
          append;//添加模式
              end; 
          with DataSource1.DataSet.Fields  do
             begin
               Fields[0].Value:=strtotime(edit1.Text);
             end;  
          ADODataSet1.Post;
          showmessage('数据添加成功!');
       except
         showmessage('数据添加失败');
       end;
    end;
      

  5.   

    上面的三种模式只选择其中一个
    Main.cnnstr是连接字符串,
    'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+getcurrentdir+'数据库名称.mdb;Persist Security Info=False';
    这是ACCESS数据库,如果是ODBC,
    Provider=MSDASQL.1;Persist Security Info=False;Data Source=ODBC数据库名称