BUG: SQLNumResultCols May Fail After Prepared SQL StatementLast reviewed: September 9, 1996Article ID: Q124899 |
The information in this article applies to:
BUG# AddonBugs: 10888 (1.02.3231)
SYMPTOMSAfter preparing a SELECT statement, a call to an ODBC meta data function call, such as SQLDescribeCol, SQLNumResultCols, and SQLColAttributes, fails with the message:
Syntax error near 'where'This happens only if the above functions are called after SQLPrepare has been called but before SQLExecute has been called. The following code demonstrates the problem:
SQLPrepare(hstmt, "select sum(qty) from sales group by stor_id") SQLNumResultCols(hstmt, &col) ==> SQL_ERROR SQLError() ==> "Syntax error near 'where'" CAUSEThe SQL Server driver is sending an improperly constructed SQL statement to SQL Server at the time SQLNumResultCols, SQLDescribeCol, and SQLColAttributes are called.
WORKAROUNDBecause this problem appears only if SQLExecute has not been called, it is recommended that meta data function calls be called after both SQLPrepare and SQLExecute have been called.
STATUSMicrosoft has confirmed this to be a problem in the 16-bit Microsoft SQL Server driver version 1.02.3231 and 32-bit SQL Server driver version 2.00.1912. We are researching this problem and will post more information here in the Microsoft Knowledge Base as it becomes available.
|
Additional reference words: 1.02.3231 2.00.1912 Windows NT
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |