sql语句
  create database ...

解决方案 »

  1.   

    将数据库文件编译进可执行文件,要建的再保存到磁盘
    例子:
    建立一个扩展名为“.rc” 的文件,内容如下:
    database RCDATA "d:\access\demo.mdb",
    保存为e:\test\test.rc后,编译为资源文件,编译方法如下(注:相应的路径需要改变)
    E:\delphi6\Bin\brcc32.exe E:\test\test.rc然后在源文件中加入该资源文件。
    {$R test.res}要建立数据库的读出,并保存到磁盘上。
    procedure TForm1.Button1Click(Sender: TObject);
    var
      RS: TResourceStream;
    begin
      RS := TResourceStream.Create(Hinstance, 'database', RT_RCDATA);
      RS.SaveToFile('test.mdb');
    end;
      

  2.   

    with Table1 do begin
      Active := False;  
      DatabaseName := 'DBDEMOS';
      TableType := ttParadox;
      TableName := 'CustInfo';  { Don't overwrite an existing table }  if not Table1.Exists then begin
        { The Table component must not be active }
        { First, describe the type of table and give }
        { it a name }
        { Next, describe the fields in the table }
        with FieldDefs do begin
          Clear;
          with AddFieldDef do begin
            Name := 'Field1';
            DataType := ftInteger;
            Required := True;
          end;
          with AddFieldDef do begin        Name := 'Field2';
            DataType := ftString;
            Size := 30;
          end;
        end;
        { Next, describe any indexes }
        with IndexDefs do begin
          Clear;
          { The 1st index has no name because it is
          { a Paradox primary key }
          with AddIndexDef do begin
            Name := '';
            Fields := 'Field1';
            Options := [ixPrimary];
          end;
          with AddIndexDef do begin        Name := 'Fld2Indx';
            Fields := 'Field2';
            Options := [ixCaseInsensitive];
          end;
        end;
        { Call the CreateTable method to create the table }
        CreateTable;
      end;
    end;
    把tabletype该为access,
      

  3.   

    看看delphi目录下的ocx\servers中的dao97及dao2000,_DBEngine接口中有createdatabase方法可用于创建access数据库