设置数据链接文件而不是连接字符串
delphi 7中,
打开数据库连接时,可以选择数据链接文件,或连接字符串。
当程序编译时,它使用连接字符串进行连接。在运行时,需要更改为用户输入 udl。
为了改变连接需要改变什么属性?
delphi 7,
when opening a connection to db, you can choose data link file, or Connection String.
when the program compiles , it connects with connection string. on run time, there is a need to change to an user input udl.
what is the property to change in order to change the conneciton?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的代码假设您有一个用于选择文件的 TOpenDialog (OpenDialog1) 实例和一个 TAdoConnection (AdoConnection1) 实例。它根据所选的 .udl 文件设置连接字符串。
The code below assumes you have an instance of TOpenDialog (OpenDialog1) for selecting a file, and an instance of TAdoConnection (AdoConnection1). It sets connection string according to the selected .udl file.