ADO+access数据库```如何设相对路径.我写好的程序无法在别人机器上用...
发布网友
发布时间:2024-10-24 02:40
我来回答
共1个回答
热心网友
时间:2024-11-10 21:37
var
DatabaseFileName: string;
begin
DatabaseFileName:= ExtractFilePath(Application.ExeName) + 'Data.mdb';
with ADOQuery1 do begin
Close;
ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +
DatabaseFileName + ';Persist Security Info=False';
//SQL.Clear;
//SQL.Add('Select * from 表');
Open;
end;
end;