Microsoft KB Archive/73215

{|
 * width="100%"|

PRB: Reasons for Error 10008: Bad Token from SQL Server

 * }

Q73215

-

The information in this article applies to:


 * Microsoft SQL Server Programmer's Toolkit, version 4.2

-

SYMPTOMS
When you run a DB-Library (DB-Lib) application, the following error message is received:

Error 10008, Bad token from SQL Server: Datastream processing out of sync.

CAUSE
A DB-Lib application communicates with a SQL Server across the network using a tabular data stream (TDS). This TDS is transmitted across a named pipe, which is provided and maintained by the network operating system. Each DB-Lib application automatically parses this TDS to extract useful information (for example, query result rows).

When DB-Lib cannot interpret the TDS, it generates a 10008 error:

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

There are two potential causes for this error:


 * 1) The first possible cause is that the data coming across the network named pipe has been corrupt. This is always caused by some kind of network problem involving either network hardware or software.
 * 2) The second possible cause is that the network has sent a message across the named pipe. For example, in LAN Manager version 2.0 if the numreqbuf value in the [server] section of LANMAN.INI is too low, the number of named pipes that can be open at one time will be limited. When this occurs, LAN Manager sends an error across the named pipe; dblib does not understand the error and generates a 10008 error.

WORKAROUND
Check for possible network problems, or run network diagnostics. Remember that the problem can involve any of the networking hardware or software, on the server and/or on the client.

For more information on the second problem and how to increase the numreqbuf value, query on the following words in the Microsoft Knowledge Base:

"(configuring) and (LAN Manager) and (Peer Service) and (SQL Server)"

When you write a DB-Lib application, the 10008 error can be gracefully handled by having the error handler of the DB-Lib application trap the 10008 error. After receiving it, you can close the DBPROCESS connection, open a new one, then resend the query.

Additional query words: Windows NT

Keywords : kbnetwork

Issue type :

Technology : kbSQLServSearch kbAudDeveloper kbSQLServPTK420