使用 Delphi 和 dbExpress 连接到 SQL Server
我使用 RAD Studio 2010,包括最新更新 4 和 5,我的数据库是 SQL Server Express。
我设置了 TSQLConnection 但无法连接,错误消息是“DBX-Error: 驱动程序无法正确初始化。客户端库可能丢失,可能未正确安装,或者可能版本错误”(错误消息翻译自德语)。
通过 TADOConnection 连接到数据库对于两个 ADO 驱动程序(“Microsoft OLE DB Provider for SQL Server”和“SQL Native Client”)都可以正常工作。
有人能给我提示如何通过 dbExpress 连接吗?
I use RAD Studio 2010 including latest updates 4 and 5, my database is SQL Server Express.
I set up a TSQLConnection but it won't connect, error message is "DBX-Error: the driver could not be initialized correctly. A client library may be missing, may not be installed correctly, or may have the wrong version" (error messagetranslated from German).
Connecting to the database via TADOConnection works fine with both ADO drivers ("Microsoft OLE DB Provider for SQL Server" and "SQL Native Client").
Can anybody give me a hint how to connect via dbExpress?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你需要安装sql本机客户端,如果你阅读RAD studio 2010附带的自述文件,它说这是连接到sql server 2000/2005/2008的要求
我还发现在dbxdrivers.ini中他们没有没有为 MSSQL 2000/2005 添加正确的选项,您需要编辑顶部位以在 MSSQL9=1
示例中添加:
然后您可以选择 MSSQL9 作为 dbExpress 选项,它也应该出现在数据资源管理器中
you need to install the sql native client, if you read the read me that comes with RAD studio 2010 its says that it is a requirement for connecting to sql server 2000/2005/2008
I’ve also discovered that in dbxdrivers.ini they haven’t added the proper option for MSSQL 2000/2005 you need to edit the top bit to add in MSSQL9=1
example:
you can then select MSSQL9 as a dbExpress option and it should also appear in data explorer as well
我在使用 Delphi XE2 和 SQL Server 2005 时遇到了类似的问题。我卸载并安装了 SQL Native Client 的多个版本(包括 MSSQL 2008 R2),但均无济于事。但是将 MSSQL9=1 添加到 ini 文件中就可以了。
I had a similiar issue with Delphi XE2 ad SQL Server 2005. I uninstalled and installed several versions (including MSSQL 2008 R2) of SQL Native Client to no avail. But adding MSSQL9=1 to the ini file worked.
也许 EDN(Embarcadero 开发者网络)上的此帖子会有所帮助。
Maybe this thread on the EDN (Embarcadero Developer Network) can be helpful.