freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
[freetds] Request for change in dblib.c in dbsetlversion
- From: LacaK <lacak AT zoznam.sk>
- To: freetds AT lists.ibiblio.org
- Subject: [freetds] Request for change in dblib.c in dbsetlversion
- Date: Fri, 20 Aug 2010 07:14:41 +0200
Hi *,
I am playng with "db-lib" as a DB API for my FreePascal project.
I want use dblib.dll to connect to MS SQL Server 7+
So I want to set appropriate TDS protocol version using call to "dbsetlversion"
(Yes, I know that I can set TDS protocol version by env.var. TDSVER or freetds.conf, but I am looking for way how to set it in program).
So I use dbsetlversion with DBVER60 (becase it accepts only DBVER42 (which is too old and does not support new features) and DBVER60)
DBVER60 is defined like DBVERSION_70 (and DBVERSION_70 is used when TDS70 is defined), but in code is set:
login->tds_login->tds_version=0x600
In this case in log file appears:
...
net.c:225:Connecting to 10.0.0.2 port 1433 (TDS version 6.0)
net.c:281:tds_open_socket: connect(2) returned "WSAEWOULDBLOCK: Resource temporarily unavailable."
net.c:321:tds_open_socket() succeeded
util.c:156:Changed query state from DEAD to IDLE
*login.c:575:Unknown protocol version!*
*login.c:462:login packet rejected*
util.c:156:Changed query state from IDLE to DEAD
util.c:331:tdserror(02290500, 02290840, 20002, 0)
dblib.c:7861:dbperror(02290610, 20002, 0)
dblib.c:7913:20002: "Adaptive Server connection failed"
...
So IMHO TDS version 6.0 is bad (http://www.freetds.org/tds.html) and should be changed to 7.0 :
(Sybase does not defines dbsetlversion, so only Microsoft is in game http://www.freetds.org/userguide/dblib.api.summary.htm)
*login->tds_login->tds_version=0x700*
And/or if possible add also other cases:
case DBVERSION_71:
login->tds_login->tds_version = 0x710;
return SUCCEED;
...
TIA
-Laco.
- [freetds] Request for change in dblib.c in dbsetlversion, LacaK, 08/20/2010
Archive powered by MHonArc 2.6.24.