Menu

Using an ODBC driver without installing it Log in to Edit

marsupilami79

We didn't test it but it seems that a Zeos user found a way to to use an ODBC driver without installing it:
https://forum.lazarus.freepascal.org/index.php/topic,66839.0.html

I think I've solved it with ZeosLib 8.0.0-release. Works even at design time in Laz IDE.
Trick is to provide part of connection string in the Database property (TZConnection):
Database=[..];Hostname=[..];Port=[..];
Provide User and Password in respective properties of TZConnection.
Then, Protocol to odbc_a or odbc_w.
Lastly, LibraryLocation to db2clio.dll - at design time absolute path ofc.
At runtime just change LibraryLocation to relative path, I have:
driverLocation := ExtractFilePath(Application.Exename) + 'driver' + directoryseparator + 'bin' + directoryseparator + 'db2clio.dll';
Probably driver/cli content of the IBM package (here v11.5.9_ntx64_odbc_cli.zip) can be slimmed down (right bitness, etc.) - but it uses quite a bit of included libraries, I'm not sure how to leave right ones only other then by trial and error...