ODBC lib Specified driver could not be loaded

TheFrack picture TheFrack · Apr 30, 2012 · Viewed 14.6k times · Source

I am trying to install ODBC drivers and I am running into brick walls.

[root@Crux pkg]# isql -v
[IM002][DataDirect][ODBC lib] Data source name not found and no default driver specified
[ISQL]ERROR: Could not SQLConnect
[root@Crux pkg]# isql -3 SUBS2A
[IM003][DataDirect][ODBC lib] Specified driver could not be loaded
[ISQL]ERROR: Could not SQLConnect

My INI files are as follows;

odbcinst.ini

[ProgressOpenEdge]
Description = ODBC for Progress OpenEdge
Driver = /usr/dlc/odbc/lib/pgoe1023.so
;Setup = /usr/dlc/odbc/lib/pgoe1023.so
FileUsage = 1

odbc.ini

[SUBS2A]
Driver = ProgressOpenEdge
Description = Fail
DatabaseName = SUBS
PortNumber = 4000
HostName = 192.168.1.2
LogonID = SYSPROGRESS
Password = SYSPROGRESS
APILevel = 1
ConnectFunctions = YYN
CPTimeout = 60
DriverODBCVer = 03.50
FileUsage = 0
SQLLevel = 0
UsageCount = 1
ArraySize = 50
DefaultLongDataBuffLen = 2048
DefaultIsolationLevel = REPEATABLE READ
StaticCursorLongColBuffLen = 4096
[ODBC]
InstallDir = /usr/dlc/odbc
Trace = 0
TraceFile = odbctrace.out
TraceDll = /usr/dlc/odbc/lib/odbctrac.so
UseCursorLib = 0

I have already made sure all dependencies are loaded properly via ldd.

UPDATE

OUTPUT OF: strace isql -v http://pastebin.com/tXFY4vVt

OUTPUT OF: strace isql -3 SUBS2A http://pastebin.com/Yu5e54mR

OUTPUT OF: /tmp/odbctrace.out http://pastebin.com/0kgvNdWv

Thanks

Answer

Yves Martin picture Yves Martin · May 3, 2012

You should check that your ODBC driver is loadable:

ldd /usr/dlc/odbc/lib/pgoe1023.so

Probably the loader fails to find dependencies as shared objects (so libraries) that are not available yet in your environment or available in different version.

I recommend you add /usr/dlc/odbc/lib/ or maybe other paths according to your system:

  • either in the environment variable LD_LIBRARY_PATH
  • either add a specific file for linux loader, for instance /etc/ld.so.conf.d/odbc-pgoe.conf with the line /usr/dlc/odbc/lib/ and refresh with ldconfig (best option)

Please report the ldd command output if problem persists. Maybe expected libraries file names do not match exactly your Linux distribution.

Update : The last comment of this post confirms that a ld.so.conf file is a solution to get the driver working. You should test it.

This forum refers to a similar situation. Maybe the solution will fix your issue.

If still wrong, please report the output of strace isql -3 SUBS2A. You will probably get a clue there of what is wrong like a failed library loading, a file access permission issue or whatever, just before the error message is written.