6

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.

6
  • Did you try to put the gds32.dll in the same folder where you have your binary? Also I remember you have to add some other files besides the gds32.dll.
    – CrApHeR
    May 6, 2015 at 2:12
  • What is the bitness (32 bit or 64) of: Windows, your Firebird install and the installed ODBC driver? May 6, 2015 at 7:18
  • @CrApHeR Yes, I did. But which file are you referring to? May 14, 2015 at 22:56
  • @MarkRotteveel We have 32bit Firebird installed in 64 bit of Windows. May 14, 2015 at 22:58
  • @hanhanStacey I used Firebird with an embebed server. I think that is because I put more files in the same folder. Maybe the problem is caused by a 32bits/64bits incompatibility. (The library was compiled for 32 bits specifically and it was not compiled for any CPU). Did you try to compile your project only for 32bits to check if that works?
    – CrApHeR
    May 14, 2015 at 23:15

1 Answer 1

14

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?

1
  • Hi Mark,thank you so much for this helpful advice. The problem is solved now! Really appreciate your contribution and efforts. May 17, 2015 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.