【问题标题】:ODBC Firebird Driver Unable to connect to data source;library'gds32.dll' failed to loadODBC Firebird 驱动程序无法连接到数据源;库“gds32.dll”加载失败
【发布时间】:2015-05-06 01:53:38
【问题描述】:

我想在 ODBC 和 Firebird 之间建立连接。它显示了如下错误消息:

[ODBC Firebird 驱动程序] 无法连接数据源;库“gds32.dll”加载失败

[ODBC Firebird 驱动程序] 无效的连接字符串属性。

这是我的代码:

Dim conn As ADODB.connection            
Dim vError As Variant                   
Dim sErrors As String                  
Dim stringsql As Long               
Dim dbs As DAO.Database                
Dim recordset_case As ADODB.Recordset

'*************************************************************
'Setting up connection between IRIS data and central database
'***********************************************************
'1.set up connection
Set conn = New ADODB.connection
On Error Resume Next
conn.Open "DRIVER=Firebird/InterBase(r) driver; 
DBNAME=C:\IRIS\Data\IRIS_TEST.IB; UID=SYSDBA; PWD=masterkey;READONLY = YES"
On Error GoTo 0

'to test whether the connection has been built over the IRIS and central database
If conn.State = adStateOpen Then
    'adstateopen=the object is open
    MsgBox "Connection Succeeded", vbInformation
Else
    For Each vError In conn.Errors
        sErrors = sErrors & vError.Description & vbNewLine
    Next vError
    If sErrors > "" Then
        MsgBox sErrors, vbExclamation
    Else
        MsgBox "Connection Failed", vbExclamation
    End If
End If

在这个阶段,我尝试了以下步骤:

  1. 基于this article,我已将 fdclient.dll 重命名为 gds32.dll 并复制到 system32 文件。然后我在 Firebird ODBC 驱动程序设置中选择了 Firebird 客户端库。
    这不起作用。

  2. Uninstall and reinstall Firebird。由于 Firebird 是我们软件包的一部分,我们确实遵循了该步骤。此外,我们检查了 Firebird 是 2.5.4 的最新版本。因此,我们确实拥有最新版本的 Firebird 服务器。
    那也不行。

【问题讨论】:

  • 您是否尝试将 gds32.dll 放在存放二进制文件的同一文件夹中?另外我记得除了 gds32.dll 之外,您还必须添加一些其他文件。
  • 什么是位数(32 位或 64 位):Windows、您的 Firebird 安装和已安装的 ODBC 驱动程序?
  • @CrApHeR 是的,我做到了。但是你指的是哪个文件?
  • @MarkRotteveel 我们在 64 位 Windows 中安装了 32 位 Firebird。
  • @hanhanStacey 我将 Firebird 与嵌入服务器一起使用。我认为这是因为我将更多文件放在同一个文件夹中。也许问题是由 32bits/64bits 不兼容引起的。 (该库是专门为 32 位编译的,它不是为任何 CPU 编译的)。您是否尝试仅将项目编译为 32 位以检查其是否有效?

标签: odbc firebird2.5


【解决方案1】:

在 Windows 64 位上,32 位 dll 文件位于 SysWoW64,而不是 system32(从逻辑上讲...,包含 64 位 dll)。

如果您想安装 32 位 gds32.dll,我强烈建议您使用 Firebird 安装中包含的 instclient.exe,而不是重命名 fbclient.dll。对于 64 位 Firebird,bin\ 中的 Firebird 用于 64 位,32 位在 wow64wow 中(我相信,我手头没有安装 Windows)。

要运行instclient.exe,请以管理员身份启动命令提示符。

要安装 fbclient.dll,请使用:

instclient i f

要安装 gds32.dll,请使用:

instclient i g

确保选择正确的 instclient(来自 bin 的 64 位或来自 wowwow64 的 32 位);或者只是安装两者。还要确保您已经为 Firebird 安装了 32 位 ODBC 驱动程序。

关于您的最后一条评论:我无法解释这一点;也许它使用不同的配置或驱动程序?

【讨论】:

  • 嗨,马克,非常感谢您提供的有用建议。现在问题解决了!非常感谢您的贡献和努力。
  • 你为什么不把这个标记为答案@hanhanStacey?
猜你喜欢
  • 1970-01-01
  • 2019-08-04
  • 1970-01-01
  • 1970-01-01
  • 2018-10-04
  • 2019-07-24
  • 1970-01-01
  • 2016-07-24
  • 2012-09-17
相关资源
最近更新 更多