Interbase connection UniDAC x64

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ehoberg
Posts: 2
Joined: Mon 08 Jan 2018 14:39

Interbase connection UniDAC x64

Post by ehoberg » Mon 08 Jan 2018 15:12

Hello,

I`m having issues setting up a connection from a 64 bit application to an interbase server.
It kind of looks like the 64 bit UniDAC is attempting to load 32 bit dll's which in turn results in fatal errors.

To ensure that we our own code is not at fault, we opened up the UniDacDemo project provided by the installation and we encountered the same issue. On connection attempt it crashes with the following error:

Project UniDacDemo.exe raised exception class Exception with message 'Cannot load client library'.

After searching the unidac connection source code, it looks like the IBCCallUni.pas does not take 64 bit into account when loading the dll's:

{$IFDEF MSWINDOWS}
GDSDLLName = 'gds32.dll';
FBClientDLLName = 'fbclient.dll';
IBXMLDLLName = 'ibxml.dll';
{$ELSE}

I could be wrong here, however when making a small test project and attempting to connect to the same database using FireDAC (TFDConnection) , the connection is successfully established. Doing the same with the TUniConnection component, results in the same fatal error.

Any suggestions how to solve/work around this would be appreciated.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Interbase connection UniDAC x64

Post by ViktorV » Tue 09 Jan 2018 10:28

The error can occur when you use client libraries, bitness of which does not match your application bitness.
The bitness of the used client libraries must match your application bitness, regardless of the bitness of the server you are using.
Both 32 bit and 64 bit Firebird client libraries are called the same - fbclient.dll and each of them comes with the Firebird distribution of the corresponding bitness. To use the 64 bit solution of the Firebird client library, you can download the Firebird 64 bit distribution from http://www.firebirdsql.org/en/downloads and use the fbclient.dll client library distributed with it.
To solve the issue, please try to specify the path to a client library in the TUniConnection.SpecificOptions.Values ['Clientlibrary'] property and use the following code:

Code: Select all

UniConnection1.ProviderName: = 'InterBase';
UniConnection1.SpecificOptions.Values ['ClientLibrary']: = ClientLibraryFullPath;

ehoberg
Posts: 2
Joined: Mon 08 Jan 2018 14:39

Re: Interbase connection UniDAC x64

Post by ehoberg » Fri 12 Jan 2018 12:11

Thanks for the help. That was indeed the issue.
As it turns out, my local installation of interbase does have a 64 bit version of ibclient.dll, called ibclient64.dll. After pointing to that specific dll, it does establish a connection.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Interbase connection UniDAC x64

Post by ViktorV » Fri 12 Jan 2018 13:05

It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.

rfbeiboer
Posts: 2
Joined: Mon 15 Jan 2018 09:52

Re: Interbase connection UniDAC x64

Post by rfbeiboer » Mon 15 Jan 2018 09:59

The question remains, why does UniDAC tries to load the gds32.dll in a 64-bit build of the code? We (I am in ehoberg's team) are not using the Firebird client but the Interbase client. The 32-bit client dll is called gds32.dll and the 64-bit client dll is called ibclient64.dll. But the sources make clear that it tries to load gds32.dll even when compiled in 64-bit. Shouldn't that be changed in the sources?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Interbase connection UniDAC x64

Post by ViktorV » Mon 15 Jan 2018 13:22

We will try adding this functionality to the next UniDAC build.

Post Reply