Delphi中使用ADO连接带密码的Access


本文整理自网络,侵删。

 

 Delphi中使用ADO连接带密码的Access

 

var gDBConn:string;


try
self.ADOConnection1.Close;
//无密码连接方式 Password="";
//gDBConn:='Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=MyDB.mdb;Persist Security Info=True';
//有密码连接方式 Jet OLEDB:Database Password=delphi7;
gDBConn:='Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=123456;Data Source='+ExtractFilePath(application.ExeName)+'MyDB.mdb;Persist Security Info=True';
self.ADOConnection1.ConnectionString := gDBConn;
self.ADOConnection1.Open;
except
//raise;
self.ADOConnection1.Close;
self.ADOConnection1.Free;
application.MessageBox('不能连接到数据库!','提示信息',64);
application.Terminate;
end;

相关阅读 >>

Delphi自有的md5函��

Delphi从网上获取北京时间

Delphi xe10 手机内部系统相关操作(手机信息、震动、剪贴板、键盘、电话、拨号)

Delphi 调用打印软件代码

Delphi 多重循环

Delphi中formatdatetime函数的用法

Delphi把一个字符串中的某个子串,用另一个子串去替换

Delphi 与 c# 生成不带bom的utf8文件

Delphi 在tmemo中查找文本

Delphi的tclientsocket组件和tserversocket组件(c/s)说明

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...