Article ID: 238116 - View products that this article applies to.
This article was previously published under Q238116
When using the SQL Server ODBC driver with forward-only server-side cursors in trying to access a local temporary SQL Server table that was explicitly created using the same ActiveX Data Object (ADO) connection object, the application receives the following error message:
The HRESULT obtained is:
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#temptable12'.
DB_E_NOTABLE // 0x80040e37
The SQL Server ODBC driver does not support multiple active recordsets on the same connection when using the forward-only cursor. The OLE DB Provider for ODBC drivers attempts to work around this limitation by creating a second connection. Since temporary tables are only visible to the connection that created it, the application fails to find the table and returns a DB_E_NOTABLE HRESULT.
Use one of the following solutions to correct the problem:
Steps to Reproduce this Error
Visual C++ 6.0 Sample Code
Note You must change uid=<username> and pwd=<strong password> to the correct values before you run this code. Make sure that uid has the appropriate permissions to perform this operation on the database.
Article ID: 238116 - Last Review: December 5, 2003 - Revision: 5.1
Contact us for more help
Connect with Answer Desk for expert help.