解决PB连接SQL错误Unable to load the requested Database interface

标签:
pb连接sql错误unabletoloadtherequedatabaseinterface杂谈 |
分类: 代码天地 |
SQL SERVER数据库连接的一些问题
PowerBuilder 9.0
一、ntwdblib.dll 作用 及其版本
1 PowerBuilder等编程语言连接SQL
Server时,需要ntwdblib.dll,若没有或者版本不正确,连接时会出现如下错误提示:Unable to load the
requested Database interface. Please make sure both the interface
and client software are properly installed.

2 ntwdblib.dll和SqlServer对应关系:
3 本机没有的话,可从网上下载,并注意查看动态库的版本信息。
版本正确后,并将它复制到
32位系统的C:/WINDOWS/system32,
64位系统的C:\Windows\SysWOW64 。


二、版本配置查看
这里是win7 64位系统下安装的PB9.0,启动后 从菜单上转到, Tools --
Database Profile -- MSS Microsoft SQL Server --
Utilities -- Client Configuration Utility
1 DB library
DB Library Version: 8.00.2039
DB DLL Version:C:\Windows\SysWOW64\NTWDBLIB.DLL
DB DLL Date:2012/3/9 (YYYY/M/D)
DB DLL Size:290816 Bytes
2 Net Library Configuration
Default Network: Named Pipes
Net Library
Net Library Version: 8.0.341
Net DLL Version:C:\Windows\SysWOW64\DBNMPNTW.DLL
Net DLL Date:2009/7/14 (YYYY/M/D)
Net DLL Size:32768 Bytes

3 Advanced 保持为空即可
如果以上信息不对,参看第一步,重新从网络上下载,复制到目标文件夹下。
也可能需要 msvcr71.dll 等其它的动态库,可按需要下载。
三 可能需要的SQL Server 方面的操作
如果以上信息正确,还是不能工作,可如下操作
1 右击 计算机 -- 管理 -- 服务和应用程序 -- SQL Server配置管理器 -- SQL Server
网络配置
2 右击 计算机 -- 管理 -- 服务和应用程序 -- 服务
四 成功后创建的新数据库连接 样例
// Profile trsdb_dq
SQLCA.DBMS = "MSS Microsoft SQL Server"
SQLCA.Database = "trsdb_dq" //数据库名称
SQLCA.LogPass = <**********>
SQLCA.ServerName = "connect2"//服务器名称
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""