How to determine database driver version?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ralfiii
Posts: 25
Joined: Wed 16 Mar 2011 09:25

How to determine database driver version?

Post by ralfiii » Tue 20 Mar 2012 18:05

Hello!

Is there a way to determine the version of the installed database driver using IbDac?
In my old code I've read the version from the registry under
HKLM\Software\Firebird Project\Firebird Server\Instances
but this makes troubles as you might have a 64bit Windows with 64 or 32 bit drivers...

I tried using TIbcVersionInfo but

Code: Select all

     with TIbcVersionInfo.Create do
     begin
          ShowMessage('>'+ServerVersion+''+.ServerImplementation+''+Inttostr(ver.ServiceVersion)+'<');
     end;
doesn't give anything but empty strings.

Thanks,
Ralf S.

AndreyZ

Post by AndreyZ » Wed 21 Mar 2012 07:12

Hello,

To obtain server version, you can use either TIBCConnection or TIBCServerProperties. Here are code examples demonstrating both ways:

Code: Select all

IBCConnection.Open;
if IBCConnection.DatabaseInfo.FBVersion  '' then
  ShowMessage(IBCConnection.DatabaseInfo.FBVersion)
else
  ShowMessage(IBCConnection.DatabaseInfo.Version);

Code: Select all

IBCServerProperties.Attach;
IBCServerProperties.FetchVersionInfo;
ShowMessage(IBCServerProperties.VersionInfo.ServerVersion);

ralfiii
Posts: 25
Joined: Wed 16 Mar 2011 09:25

Post by ralfiii » Wed 21 Mar 2012 09:04

That generally works fine, but this way I only see the version of the server.

If I connect from a client PC to the server I'd also like to know which version the driver on the client PC has.
(Let's say the server uses FB2.5 and the client FB2.1.3 then this may explain certain problems the software has during operation)

Can this be done with IBC?

AndreyZ

Post by AndreyZ » Wed 21 Mar 2012 14:02

To obtain client version, you can use the following code:

Code: Select all

IBCConnection.Open;
ShowMessage(TDBAccessUtils.GetIConnection(IBCConnection).GetClientVersion);

ralfiii
Posts: 25
Joined: Wed 16 Mar 2011 09:25

Post by ralfiii » Wed 21 Mar 2012 14:43

Strange, this returns "6.3".
I connect to a firebird 2.1.3 server with firebird client drivers version 2.5.1

AndreyZ

Post by AndreyZ » Thu 22 Mar 2012 12:53

I cannot reproduce the problem. I have tried to connect to Firebird server 2.1.3 using the fbclient.dll library from Firebird 2.5.1 and there were no problems with getting the correct client library (2.5). Please try using the latest IBDAC version 4.1.5 and check if the problem persists. If it does, please specify the bitness (x32, x64) of your Firebird server and client. Also make sure that you are really using the fbclient.dll library from Firebird 2.5.1.

Post Reply