FIX: TDS Errors in a Multithreaded ODBC Application

Exención de responsabilidades de contenido KB retirado

Este artículo se refiere a productos para los que Microsoft ya no ofrece soporte técnico. Por tanto, el presente artículo se ofrece "tal cual" y no será actualizado.

2.65
WINDOWS
kbusage kbinterop kbbug2.65 kbfix6.50.sp2
BUG #: 15705 (SQLBUG_65)


Symptoms

When two or more threads share the same database connection (but different hstmts), a call to SQLExecDirect or SQLExecute fails, and one of the following errors occurs:

[Microsoft][ODBC SQL Server Driver][SQL Server] Received an unrecognized datatype 0 from TDS data stream
[Microsoft][ODBC SQL Server Driver]Unknown token received from SQL Server
[Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream
The error(s) received depends on which network library (TCP/IP sockets or named pipes) is being used.

Workaround

To work around this problem, do one of the following:


  • Use a Critical Section object around SQLExecDirect or SQLExecute.
  • Use a different connection for each thread, rather than sharing the same connection.
  • Add a Sleep function for about 1,000 to 5,000 milliseconds before SQLExecDirect or SQLExecute.

Status

Microsoft has confirmed this to be a problem in Microsoft SQL Server ODBC Driver version 2.65. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.
Propiedades

Id. de artículo: 154295 - Última revisión: 12/02/2002 - Revisión: 1

Comentarios