Page 1 of 1

FreeTDS libraries

Posted: 08.10.2012, 15:11
by mario13
I'm a bit confused about the FreeTDS libraries to use. Form SVN revision 1907, in ZPlainDbLibDriver.pas the libraries are:
NTWDBLIB_DLL_LOCATION ='ntwdblib.dll';
LIBSYBDB_WINDOWS_DLL_LOCATION = 'libsybdb.dll';
LIBSYBDB_LINUX_DLL_LOCATION = 'libsybdb.so';
FREETDS_MSSQL_WINDOWS_DLL_LOCATION = 'msdblibr.dll';
FREETDS_LINUX_DLL_LOCATION = 'dblib.so';
FREETDS_OSX_DLL_LOCATION = 'dblib.dylib';
FREETDS_SYBASE_WINDOWS_DLL_LOCATION = 'sybdblibd.dll';

- In general it should be noted that FreeTDS doesn't work with Named Pipes, it only works with a TCP/IP connection on a fixed port like 1433.

- In Windows, the msdblibr.dll requires msvcrt100.dll, but it can be changed to msdblibd.dll which doesn't have this requirement (I think this comment should apperar in ZPlainDbLibDriver.pas with both libraries, one commented out, the other not).

- In Debian Testing, from package manager, I have this related libraries (the first three are from FreeTDS project)
libct.so from package libct4
libsybdb.so from package libsybd5
libtdsodbc.so from package tdsodbc
mssql.so from package php5-sybase
pdo_dblib.so from package php5-sybase

In Debian Testing, the command line utility tsql depends on libsybdb.so and could connect ok to MSSQL 2000. On the other hand, the command line utility sqsh depends on libct.so and also works ok.

So, there is no 'dblib.so', but if I replace in ZPlainDbLibDriver.pas
FREETDS_LINUX_DLL_LOCATION = 'libsybdb.so';
Zeos (with protocol 'FreeTDS_MsSQL-2000') could connect and works OK.
May be this should be modified in Zeos sources.

(Side note: libsybdb.so is the library used in the new TMSSQLConnection of Lazarus, in source file dblib.pas of FPC. For Windows, in this file it use 'dblib.dll' which was impossible to find, and the ones -with other names- provided with Zeos doesn't work. It appears that dblib is an older name.)