在打开的按纽加入以下代码
=====================================
var
j:string;
if openDialog1.Execute then
begin
j:='provider=Microsoft.Jet.OLEDB.4.0;user ID=Admin;Data Source='
+openDialog1.filename+';'
+'Mode=Share Deny None;Extended Properties="";'
+'Jet OLEDB:System database="";'
+'Jet OLEDB:Registry Path="";'
+'Jet OLEDB
atabase Password="123";' //设定密码为123
+'Jet OLEDB:Engine Type=5;'
+'Jet OLEDB
atabase Locking Mode=1;'
+'Jet OLEDB:Global Partial Bulk Ops=2;'
+'Jet OLEDB:Global Bulk Transactions=1;'
+'Jet OLEDB:New Database Password="";'
+'Jet OLEDB:Create System Database=False;'
+'Jet OLEDB:Encrypt Database=False;'
+'Jet OLEDB
on'+''''+'t Copy Locale on Compact=False;'
+'Jet OLEDB:Compact Without Replica Repair=False;'
+'Jet OLEDB:SFP=False';
ADOConnection1.LoginPrompt:=false;
ADOConnection1.ConnectionString:=j;
end;