首先要设置工作目录
SetCurrentDir(Extractfilepath(Application.ExeName));
然后再使用相对路径
你写在Create事件下没错
你应当重新编写连接字符串
procedure TForm1.FormCreate(Sender: TObject);
begin
SetCurrentDir(Extractfilepath(Application.ExeName));
ADOConnection1.Clsoe;
ADOConnection1.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=bir.mdb;Persist Security Info=False';
ADPConnection.Open;
end;
必须保证数据库和程序在同一目录,不然出错
放在project单元,所有窗体Create之前试试