Microsoft KB Archive/139555

= INF: Invalid Use of dbwritetext Can Cause 806 Errors =

Article ID: 139555

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft SQL Server 4.21a Standard Edition
 * Microsoft SQL Server 6.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition
 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q139555



SUMMARY
Attempting to use a single DBPROCESS to read data and perform a dbwritetext call can generate 806 errors.



MORE INFORMATION
As shown in the SQL Server "Programmers Reference for C," two DBPROCESS structures are used to perform a valid dbwritetext operation.

Some incorrect interpretations of the sample are to use one DBPROCESS. To accomplish this, the dbtxttimestamp and dxtxtptr functions are called immediately after the dbnextrow call and stored in local DBBINARY variables. However, the dbtxtptr only returns a pointer to the result set. In order to perform the dbwritetext operation without results pending on the single connection, you must finish processing all rows with dbnextrow or dbcancel calls. When the dbnextrow or dbcancel function is called, it accordingly clears the result set space, thus invalidating the dbtxtptr you stored in the memory variable.

When the call to dbwritetext is made with an invalid dbtxtptr value error #806 can be generated. The use of a single process is dangerous.

Additional query words: windows nt function

Keywords: kbinfo kbprogramming KB139555

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.