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

Last reviewed: April 25, 1997
Article ID: 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 SSrvLan SSrvWinNT
Version : 4.2 | 4.2 | 4.2
Platform : MS-DOS OS/2 WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.