Saturday, December 20, 2008

SQLTablesW/SQLTables : [24000] [Microsoft][ODBC SQL Server Driver]Invalid cursor state (0)

When you call the SQLTables function against an instance of Microsoft SQL Server 2005, you may receive an error message. The error message that you receive is based on the ODBC data source driver that you use to connect to the instance of SQL Server 2005.

If you use the SQL Native Client data source driver, you receive the following error message:
szSqlState = "24000", *pfNativeError = 0, *pcbErrorMsg = 50, *ColumnNumber = -1, *RowNumber = -1 MessageText = "[Microsoft][SQL Native Client]Invalid cursor state"

If you use the ODBC SQL Server data source driver, you receive the following error message:
szSqlState = "24000", *pfNativeError = 0, *pcbErrorMsg = 55, *ColumnNumber = -1, *RowNumber = -1 MessageText = "[Microsoft][ODBC SQL Server Driver]Invalid cursor state"

This problem occurs if the following conditions are true:
* The value that you specify in one of the following parameters of the SQLTables function contains a wildcard character:
o CatalogName
o SchemaName
o TableName
For example, one of these parameters contains an underscore (_) character or a percent (%) character.
* You specify ODBC 3.0 for the ODBC behavior of the ODBC data source driver.
* You call the SQLTables function on a server-side cursor.
For more details about the hotfix : Microsoft Page

Related

No comments: