I was able to connect to MSSQL server 2000 with Lazarus using Zeos and using the new TMSSQLConnection (SQLdb):
- First of all, for FreeTDS you have to be sure that the server is listening TCP/IP on port 1433 (o whatever you defined), you can test it with command netstat -an on the server prompt.
- For TMSSQLConnection you need FPC 2.6.1 or later, and Lazarus 1.0 or later (that component appears in the SQLdb palette).
- Windows client Native: With SQLdb the default client library points to FreeTDS dblib.dll, but I could not find such a compatible library (the ones provided with Zeos doesn't work). However, if you edit file dblib.pas (from FPC) you can enable the native Microsoft library ntwdblib.dll.
With ZEOS you can use TZConnection with protocol mssql, in this case, you must have the client library ntwdblib.dll installed. This dll works with both Named Pipes and TCP/IP connections. For Delphi (not Lazarus) it appears to be another Zeos protocol ado to be used with SQL server 2005 or later. However, note that using source code with protocol mssql or ado is not platform independient.
- Windows client FreeTDS: With SQLdb you have to provide file dblib.dll (I couldn't find one). With ZEOS you can use TZConnection with protocol FreeTDS_MsSQL-2000, in this case you must put msdblibr.dll in the same folder of your exe (which also requires msvcrt100.dll). This dll is supplied in the lib folder of Zeos, with 32 and 64 bit versions. There is only support for TCP/IP fixed port connections (no Named Pipes or dynamic ports). Also, there are other three protocol variants for different server versions.
- Wine on Linux client: Only the Zeos FreeTDS protocols and dll works (and only with TCP/IP on fixed port, no Named Pipes in Wine, no Named Pipes in FreeTDS).
- Linux Client: With SQLdb it works when FreeTDS is installed and configured (with package libsybd5). With ZEOS you can use TZConnection with protocol FreeTDS_MsSQL-2000, in this case you must have installed the FreeTDS libraries (for example in Debian the packages freetds-bin and libsybd5). For this to work you have to modify ZPlainDbLibDriver.pas in th line 68: FREETDS_LINUX_DLL_LOCATION = 'libsybdb.so';