TODBCConnection without ODBC driver installation (DB2) (Win 64-bit) lazarus / 16-Databases ---------------------------------------------------------------------- kedat · 2024-04-04 07:44 [UPDATE] - see solution with ZeosLib in the posts below. Hi, I'm able to connect (DB2 through TODBCConnection) when ODBC driver is defined/installed. I'm not using DSN since I enter all parameters during the runtime: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ODBCConnect ion.Params.Add('DRIVER=[..]');ODBCConnection.Params.Add('DATABASE=[..] ');ODBCConnection.Params.Add('HOSTNAME=[..]');ODBCConnection.Params.Ad d('PORT=[..]');ODBCConnection.Params.Add('UID=[..]');ODBCConnection.Pa rams.Add('PWD=[..]'); What I would like to omit/substitute is the DRIVER part: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  ODBCConnection.Params.Add('DRIVER=[..]); Driver is simply defined by pointing to the *.dll file, so I see no reason why this could not be done during the run time and by including the *.dll with the application Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\IBM DATA SERVER DRIVER for ODBC]   "Driver"="C:\\[..]\\db2clio.dll" I was trying to use TSQLDBLibraryLoader with ConnectionType = ODBC but this does not work - TODBCConnection still asking for DRIVER definition. Reason I'm trying to accomplish this is that now it is required that all users would have to install this driver (which requires admin rights etc...) and it seems to me that the db2clio.dll is the only missing part. ---------------------------------------------------------------------- kedat · 2024-04-09 08:16 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): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   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... ---------------------------------------------------------------------- marsupilami79 · 2024-04-10 09:09 Hello kedat even the original author of the Zeos ODBC driverd didn't know this works and was surprised (and happy). I took the liberty to add your post to our wiki: Using an ODBC driver without installing it Also we don't have experience, how Zeos works with DB2. If there are problems let me know or contact us as the forums. If it works well for you, I would like to know that too. Best regards, Jan ---------------------------------------------------------------------- kedat · 2024-04-10 15:03 Quote from: marsupilami79 on April 10, 2024, 11:09:07 ameven the original author of the Zeos ODBC driverd didn't know this works and was surprised (and happy). I took the liberty to add your post to our wiki: Great to hear and thanks for sharing. It took me quite some time to figure out proper setup - in particular for the IDE at the design to work properly but it seems it is working perfectly now. I was able to slim down the content of the original package: 160 MB => 72 MB. Also, seems you can call directly db2app64.dll instead of db2clio.dll Currently I'm left with the following files: ├───bin │   │   db2app64.dll │   │   db2osse64.dll │   │   db2trcapi64.dll │   │   IBM.DB2.APP64.manifest │   │   IBM.DB2.SEC64.manifest │   │   IBMOSauthclient64.dll │   │ │   ├───amd64.VC12.CRT [Whole folder] │   │ │   └───icc64 [Whole folder] │ └───msg [Whole folder] ---------------------------------------------------------------------- Thaddy · 2024-04-10 15:52 Note that this usually only goes for 32 bit code, since I know of only one (one, for ms access) odbc driver that is ported to 64 bit. You must have a very good reason to use odbc.... ---------------------------------------------------------------------- kedat · 2024-04-10 17:11 Quote from: Thaddy on April 10, 2024, 05:52:00 pmNote that this usually only goes for 32 bit code, since I know of only one (one, for ms access) odbc driver that is ported to 64 bit. You must have a very good reason to use odbc.... I'm compiling 64 bit app and using 64 bit driver/libraries.