比如說用ADOQuery返回的數據集(table: Customer)在本地c盤生成一個xxx.db的數據庫文件

解决方案 »

  1.   

    可以试试ADOQuery的batchmode的使用
      

  2.   


      {set up database component}
      ABSDatabase1.DatabaseName := 'emp_db';
      ABSDatabase1.DatabaseFileName := 'c:\data\employee_db.abs';  {set up table component}
      ABSTable1.DatabaseName := 'emp_db';
      ABSTable1.TableName := 'employee';  with ABSTable1 do
       begin
         {specifying table fields}
         with FieldDefs dobegin
        Clear;
             Add('EmpNo',ftAutoInc,0,False);
             Add('LastName',ftString,20,False);
             Add('FirstName',ftString,15,False);
             Add('PhoneExt',ftString,4,False);
             Add('HireDate',ftDate,0,False);
             Add('Salary',ftCurrency,0,False);
      end;
         {specifying table indexes}
         with IndexDefs do
           begin         Clear;
             Add('idxPrimary','EmpNo',[ixPrimary]);
             Add('idxByLastNameFirstName','LastName;FirstName'
    ,[ixCaseInsensitive]);
           end;
       end;  {create the database}
      with ABSDatabase1 do
       {if database file doesn't exist}
        if not Exists then
          CreateDatabase;  {and create the table}
      with ABSTable1 do   {if table doesn't exist}
        if not Exists then
          CreateTable;