2

Am trying to move my compiled C code that connects to mssql database servers from using the datadirect odbc drivers to using the unixodbc driver manager (version 2.3.1)/ freetds drivers (version 0.91) which are already compiled for 64 bit and available.

Am able to successfully compile it on 64 bit RHEL5 Linux by linking in libodbc which has already been compiled. But I get the error net.c:350: tds_select: Assertion 'timeout_seconds >= 0' failed multiple times when I run the code and the database connection fails. The environment variables I set are ODBCINI, ODBCHOME and LDD_LIBRARY_PATH (which is set to the libraries in the unixodbc path).

The driver in the odbcinst file is set to the path where libtdsodbc.so is located.

Am I missing something here. The permissions on the odbc.ini, odbcinst.ini files appear to be fine.

iain
  • 5,660
  • 1
  • 30
  • 51
  • Just a guess here (I spend far more time with PHP than I do with C nowadays) - have you modified your /etc/freetds/freetds.conf file? Is your executable aware of this conf file - do you need to set another environment variable for it? – Benny Hill Apr 11 '13 at 16:27
  • Thanks. Tried that. Does not work. Any other suggestions – user2271163 Apr 11 '13 at 16:49
  • I'm afraid not. Based on my freetds.conf file I would assume FreeTDS has a default timeout of 10 seconds so unless you've put something in the conf file like `timeout = 0` I don't know why the assertion would fail. – Benny Hill Apr 11 '13 at 17:00

0 Answers0