给你一个使用连接串的代码。
tstr:=
'Provider=Microsoft.Jet.OLEDB.4.0;'
+'Data Source='+Path+'xs.dat;' //数据库所在位置和名字
+'Mode=Share Deny None;Extended Properties="";'
+'Jet OLEDB:Registry Path="";'
+'Jet OLEDB
![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
atabase Password="zywcd13508046766";'//这里才是数据库密码
+'Jet OLEDB:Engine Type=1;'
+'Jet OLEDB
![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
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
![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
on''t Copy Locale on Compact=False;'
+'Jet OLEDB:Compact Without Replica Repair=False;'
+'Jet OLEDB:SFP=False';
if datam.DataM1.ADOConnection1.Connected=true then
datam.DataM1.ADOConnection1.Connected:=false;