Error 10008 (DB-Library)

Troubleshooting SQL Server

Troubleshooting

Error 10008 (DB-Library)

Severity Level 9
Message Text

Bad token from SQL Server: Datastream processing out of synchronization.

Explanation

This error occurs when DB-Library cannot interpret the Tabular Data Stream (TDS) sent from Microsoft® SQL Server™. A DB-Library application communicates with SQL Server over the network using a TDS. The TDS is a specification for the communication of data and other messages between SQL Server and the DB-Library client. The network libraries used by SQL Server and the DB-Library client provide the interface for the transmission of TDS over a particular network protocol. The network protocol used is independent from the TDS as long as there is an appropriate interface network library that supports the network protocol, whether it is a named pipe connection or a socket connection. Each DB-Library application parses this TDS automatically to extract useful information (for example, query result rows) or to generate requests of, or responses to, SQL Server in a format that is mutually understood.

There are two main causes for this error:

  • The data sent by SQL Server over the network named pipe or socket has been corrupted. This is usually caused by a network problem involving either network hardware or software.

  • The network can generate errors or messages unknown to DB-Library; therefore, this error can be generated.
Action

Inspect the Windows NT Event Viewer system and application logs. These logs may provide information that indicates if the problem is related to the server network protocol, the network card, or the system configuration. Review the SQL Server-specific entries in the application log or the SQL Server error log for relevant network-related errors that correspond in time with the occurrence of the 10008 error seen on the client. If this review does not provide enough information to resolve the problem, special network monitoring tools and a review of the client's configuration may be necessary.

If the problem persists, contact your primary network support provider for assistance.

Programmers using the SQL Server Programmer's Toolkit (for DB-Library) can handle error 10008 by adding conditional statements to test for the occurrence of this error. When error 10008 is seen in the DB-Library error handler, additional processing can include closing the current DBPROCESS connection, opening a new connection, and then resending the query.

See Also

Programming DB-Library for C

Reporting Errors to Your Primary Support Provider