主题:delphi动态生成dbf文件的问题
我用ado连接数据库
1--dpsconstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+SourceDress+';Extended Properties=dBase5.0;Persist Security Info=False;';
2-- dpsconstring:='Provider=MSDASQL.1;'+'Persist Security Info=False;'+'Extended Properties='+'"Driver={Microsoft Visual FoxPro Driver};'+'UID=;'+'SourceDB='+SourceDress+';'+'SourceType=DBF;'+'Exclusive=No;'+'BackgroundFetch=Yes;'+'Collate=Machine;'+'Null=Yes;'+'Deleted=Yes;"';
ADOQ1.ConnectionString:=dpsconstring;
procedure TForm1.Button1Click(Sender: TObject);
var
Sqltext,SourceDress:string;
begin
SourceDress:=e:\test1
Sqltext:='create table r1.dbf(STCODE char(6),STNAME char(8),YY char(4),MM char(2),DD char(2),DWCODE numeric(3),DWNAME char(10),';
Sqltext:=Sqltext+'SO2 numeric(6,3),NO2 numeric(6,3),PM10 numeric(6,3),O3 numeric(6,3),CO numeric(6,3))';
ADOQ2.Close;
ADOQ2.SQL.Clear;
ADOQ2.SQL.Add(Sqltext);
ADOQ2.ExecSQL;
end;
如果用第1的数据源提示找不到可安装的ISAM
如果用第2的数据源有没有在e:\test1\r1.dbf文件
急着需要答案,希望各位大哥帮帮小弟的忙,我真的不知道,谢了
来源: http://www.programbbs.com/bbs/view12-23179-1.htm#126654
1--dpsconstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+SourceDress+';Extended Properties=dBase5.0;Persist Security Info=False;';
2-- dpsconstring:='Provider=MSDASQL.1;'+'Persist Security Info=False;'+'Extended Properties='+'"Driver={Microsoft Visual FoxPro Driver};'+'UID=;'+'SourceDB='+SourceDress+';'+'SourceType=DBF;'+'Exclusive=No;'+'BackgroundFetch=Yes;'+'Collate=Machine;'+'Null=Yes;'+'Deleted=Yes;"';
ADOQ1.ConnectionString:=dpsconstring;
procedure TForm1.Button1Click(Sender: TObject);
var
Sqltext,SourceDress:string;
begin
SourceDress:=e:\test1
Sqltext:='create table r1.dbf(STCODE char(6),STNAME char(8),YY char(4),MM char(2),DD char(2),DWCODE numeric(3),DWNAME char(10),';
Sqltext:=Sqltext+'SO2 numeric(6,3),NO2 numeric(6,3),PM10 numeric(6,3),O3 numeric(6,3),CO numeric(6,3))';
ADOQ2.Close;
ADOQ2.SQL.Clear;
ADOQ2.SQL.Add(Sqltext);
ADOQ2.ExecSQL;
end;
如果用第1的数据源提示找不到可安装的ISAM
如果用第2的数据源有没有在e:\test1\r1.dbf文件
急着需要答案,希望各位大哥帮帮小弟的忙,我真的不知道,谢了
来源: http://www.programbbs.com/bbs/view12-23179-1.htm#126654