5,391
社区成员
发帖
与我相关
我的任务
分享
var
sFileName: string;
begin
sFileName := ExtractFilePath(Application.ExeName) + 'Book1.xls';
con1.Connected := False;
con1.ConnectionString:= 'Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=' + sFileName + ';Extended Properties=Excel 8.0;Persist Security Info=True';;
con1.Connected := true;
con1.Execute('create table Test(name varchar(20))');
con1.Execute('insert into Test values (''AName'')');
end;
con1.ConnectionString := 'Provider=Microsoft.ACE.OLEDB.12.0;Password="";Data Source=' + sFileName + ';Extended Properties=Excel 8.0;Persist Security Info=True';;