Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ODBC Firebird Driver Unable to connect to data source;library'gds32.dll' failed to load

I want to build a connection between ODBC and Firebird. It has shown error messages like these:

[ODBC Firebird Driver] Unable to connect to data source; library'gds32.dll' failed to load

[ODBC Firebird Driver] Invalid connection string attribute.

Here is my code:

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

At this stage, I have tried these following steps:

  1. Based on this article, I have renamed the fdclient.dll to gds32.dll and copied to system32 file. Then I selected Firebird client library in the Firebird ODBC driver setting.
    This does not work.

  2. Uninstall and reinstall Firebird. Due to Firebird being a part of our software package, we did follow that step. Beside, we have checked the Firebird is the latest version for 2.5.4. Thus, we do have the latest version for Firebird server.
    That does not work either.

like image 349
hanhan Stacey Avatar asked May 06 '15 01:05

hanhan Stacey


1 Answers

On windows 64 bit the 32 bit dll files are in SysWoW64, not system32 (that, logically..., contains the 64 bit dlls).

If you want to install the 32 bit gds32.dll, I'd strongly advise to use the instclient.exe included in the Firebird install instead of renaming fbclient.dll. For a 64 bit Firebird the one in bin\ is for 64 bit, the 32 bit is in wow64 or wow (I believe, I don't have a Windows install at hand).

To run instclient.exe, start a command prompt as administrator.

To install fbclient.dll use:

instclient i f

To install gds32.dll use:

instclient i g

Make sure you pick the right instclient (from bin for 64 bit or from wow or wow64 for 32 bit); or just install both. Also make sure you have installed the 32 bit ODBC driver for Firebird.

Regarding your last comment: I am at loss to explain this; maybe it uses a different config or driver?

like image 94
Mark Rotteveel Avatar answered Sep 22 '22 00:09

Mark Rotteveel