BUG: SQLNumResultCols Returns Zero for the pcCol Argument

Last reviewed: December 8, 1997
Article ID: Q135989

The information in this article applies to:
  • Microsoft Open Data Base Connectivity, version 2.5
BUG#: 3163 (ODBCSDK2)

SYMPTOMS

When you use the ODBC 32-bit 2.50.0121 SQL Server driver along with the 2.50.3006 Cursor Library, SQLNumResultCols returns zero for the number of columns in the result set.

This problem occurs only when the hstmt is in a positioned state.

STATUS

Microsoft has confirmed this to be a problem in the 2.50.3006 version of the cursor library. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following steps reproduce the problem:

  1. In the database, Create table test(col1 int, col2 char(10))

  2. insert test values(10,'Unchanged')

Then, use ODBC Test:

  1. Set connect option to use the cursor library. Allocate two statements, hstmt1 and hstmt2. On hstmt1, set the cursor type to 'Static', concurrency to 'Values', and cursor name to 'c1'.

  2. Do a SQLPrepare on hstmt1 and "select * from test for update of col2". Execute this statement. SQLNumResultCols at this point returns a correct value. Do a SQLFreeStmt with SQL_CLOSE option. Execute hstmt1 again. Do a SQLExtendedFetch.

  3. On hstmt2, do a SQLExecDirect on "update blow set col2='Changed' where current of c1".

  4. On hstmt1, call SQLNumResultCols again. It returns zero.

Since SQLNumResultCols is called on hstmt1 and not hstmt2, SQLNumResultCols should not be returning 0.


Additional query words: mfc sql
Keywords : kbbug2.50.3006 SSrvProg kbprg
Version : 2.5.3006 6.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.