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.Button3Click(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;"';
AdoQuery1.close;
AdoQuery1.sql.clear;
AdoQuery1.sql.Text := 'select * from ddd.dbf';
adoquery1.Open;
end;