PRB: TDS Error with Substring and Multiple ADO Recordsets (235052)
The information in this article applies to:
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q235052 SYMPTOMS
When using Microsoft SQL 6.5 and MSDASQL provider with multiple ADO client-side recordsets sharing the same connection, and using a Substring on a column, the following error may appear:
[Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream.
If you first open a connection for a recordset that does not contain a Substring, then attempt to open the second recordset containing a Substring where the columns in the Order by clause are not in the same sequence as the Select part of the SQL statement, you will see the TDS error.
CAUSE
The cursor properties on the connection object for the recordset without a Substring with Order By clause are not correct for cursor properties containing an Order By clause with Substring column.
RESOLUTION
One workaround is to simply reference the columns in the Order By clause in the same sequence as the Select part of the SQL statement. Otherwise, open the recordset containing the Substring before any other recordsets sharing the same connection object. Also, you could use another connection for the Substring recordset. This problem does not reproduce in SQL Server 7 or with the SQLOLEDB provider.
REFERENCES
For more information see SQL Books online, and search on "dbcursoropen".
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbprb KB235052 |
---|
|