T
tjqzl
Unregistered / Unconfirmed
GUEST, unregistred user!
使用ado创建:(例子如下)
//ado创建dbf
procedure TForm1.Button1Click(Sender: TObject);
var
DBPath: String;
begin
DBPath:='e:/dfwtest/test7';//你的数据库路径目录;
ADOConnection1.ConnectionString:='Provider=MSDASQL.1;'
+'Persist Security Info=False;'
+'Extended Properties='
+'"Driver={Microsoft Visual FoxPro Driver};'
+'UID=;'
+'SourceDB='+ DBPath + ';'
+'SourceType=DBF;'
+'Exclusive=No;'
+'BackgroundFetch=Yes;'
+'Collate=Machine;'
+'Null=Yes;'
+'Deleted=Yes;"';
AdoConnection1.Open;
AdoQuery1.Sql.Text := 'create table "aaa.dbf" (aaa char(2))';
//AdoQuery1.Sql.Text := 'create table "ddd.dbf" (aaa char(2)),fff float(3),eee numeric (4,1),torf boolean ,rdate date)';
AdoQuery1.ExecSql;
end;
//ado创建dbf
procedure TForm1.Button1Click(Sender: TObject);
var
DBPath: String;
begin
DBPath:='e:/dfwtest/test7';//你的数据库路径目录;
ADOConnection1.ConnectionString:='Provider=MSDASQL.1;'
+'Persist Security Info=False;'
+'Extended Properties='
+'"Driver={Microsoft Visual FoxPro Driver};'
+'UID=;'
+'SourceDB='+ DBPath + ';'
+'SourceType=DBF;'
+'Exclusive=No;'
+'BackgroundFetch=Yes;'
+'Collate=Machine;'
+'Null=Yes;'
+'Deleted=Yes;"';
AdoConnection1.Open;
AdoQuery1.Sql.Text := 'create table "aaa.dbf" (aaa char(2))';
//AdoQuery1.Sql.Text := 'create table "ddd.dbf" (aaa char(2)),fff float(3),eee numeric (4,1),torf boolean ,rdate date)';
AdoQuery1.ExecSql;
end;