Jump to content
thomedy

Incorrect SQLDA version interbase express firebird 3

Recommended Posts

Posted (edited)

 image.thumb.png.c9c9f672b59bc529029efa903af35f4a.png

im getting this error

i have traced it to a small block of  code  by IBX that sets the sqlda_version to 2


image.thumb.png.670ee479d0438ee044e79fee173384bd.png

how can i set it to 1 so i dont have to do a major refactor just yet

i can see that the header sets it to a const

 

im hoping for a solution that doesn't involve massive restructuring yet 
maybe i have to opt for a interbase alternative though

Im googling i just thought i  might ask
 

Edited by thomedy
image failed

Share this post


Link to post
Posted (edited)

image.png.ef53353a413320091f8c38805d226abd.png

 

i read that 'infile' inherits from IBX so i tried to do this

image.png.d2e32cefc67f529f9613671bba7e6eb4.png

it seems to be working ill update if necessary

UPDATE _ 


this is not the answer/solution
haha

Edited by thomedy

Share this post


Link to post

Maybe this is why it's named "Interbase Express" and not "Firebird Express"...

 

Do you do low level access to Firebird? There is a low level Firebird interface API for Delphi and Lazarus from MWA Software (https://www.mwasoftware.co.uk/fb-pascal-api). It provides comprehensive documentation including a guide to write UDRs with pascal.

Share this post


Link to post
Posted (edited)

IBX determines whether to create an ISQLVar_1 or ISQLVAR_2 based on the return from isc_get_client_version from the client library.  >= 7 is V2, otherwise V1.  Sounds like you are either using the IBClient DLL or the FB people are now returning >= 7 for that function call in their client DLL (I suspect the former moreso than the later).

 

If FB does not support SQLDA_V2 (sounds like from the error message) you need to use a client library that returns 6 or less from the isc_get_client_version.  If you want to check what the library you are loading returns call 

 

Database.GDSLibrary.GetIBClientVersion

 

where Database is an IBDatabase.  If that is >= 7 you are going to get SQLDA and SQLVar that are V2.

 

The easiest solution is probably to make sure you are using the correct client library.  Another solution is to create your own FbClient Library and your function for GetIBClientLibrary should return 6 and not call into the client DLL at all.  You can do this 1 of 2 ways.  First would be to fully copy the TIBServerLibrary class from IBX.IBInt.pas into it's own file.  Change its class name.  Modify the GetIBClientLibrary function to return 6.  In the initialization section of that new file registry your client library with the IBX library system.

 

initialization
  FbServerLibrary := TFbServerLibrary.Create;
  AddIBInterface('FbServer', FbServerLibrary);  {do not localize}
finalization
  FbServerLibrary := nil;
end.

 

A simpler, but similar method would be to take IBX.IBIntf.pas and modify the TIBServerLibrary to set GetIBClientLibrary to virtual.  Again create your own TFbServerLibrry that inherits from TIBServerLibrary and override GetIBClientLibrary to return 6.  Again do the registration it above. and add both your and the modified IBX.IBIntf.pas to your project.  Your Database's ServerLibrary would be FbServer instead of IbServer.  If you put your new interface into a design time library and install it into the IDE you will see it listed as available library files to be used at design time.  If doing this I would also override the function LibraryName: String; and return the name of the Fb client (FbClient.dll or whatever it is for 32 and 64 bits);  The there is no mistaking accidentally grabbing the IB dll when you wanted the Fb one (in the past they shipped their naming and the IB naming which could cause the wrong library to be loaded if both are available on the machine).

 

Next Interface breaking release I'll make that function virtual in the shipping version.

 

I really think it is more likely you are picking up an IB client library when loading instead of the Fb client.  I rather doubt they are returning 7+ from isc_get_client_version.  Placing a copy of the Fb client in the same directory as the exe should resolve that.

 

Please note, IBX does not support nor tested against Fb.  As long as they stay backwards compatible you should be fine, but if they don't I won't make changes to IBX to support their backward compatibility-breaking changes.

Edited by Jeff Overcash

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×