BUG: SQL Server SQLSetParam Fails on the 252nd Parameter

Last reviewed: September 9, 1996
Article ID: Q111723
The information in this article applies to:
  • Microsoft Open Database Connectivity, version 1.0

BUG# ODBCSS: 2816 (1.01.2920)

SYMPTOMS

The ODBC SQL Server driver returns an error with SQLSTATE S1093 when SQLSetParam is called for the 252nd time on a prepared statement with more than 252 parameter markers in it.

Because of this, users of Microsoft Access version 1.1 may see an error,

   ODBC Call Failed

when they try and update an attached table with more than 125 columns.

STATUS

Microsoft has confirmed this to be a problem in ODBC SQL Server Driver version 1.01.2920. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

For an ODBC application writer, do the following:

//create a table with 127 columns
CREATE TABLE lot_of_columns (col1 INT, col2 INT, ..., col127 INT)

//Prepare an update statement with 254 parameter markers
SQLPrepare: UPDATE lot_of_columns SET col1 = ?,..., col127 = ?
          WHERE col1 = ?,..., col127 = ?

SQLSetParam for each one of these parameters. The 252nd SQLSetParam returns SQL_ERROR: SQLSTATE S1093, [Microsoft][ODBC SQL Server Driver]Invalid Parameter number

For users of Microsoft Access version 1.1, do the following:

  1. Attach to a SQL Server table with 126 columns or more.

  2. Open this table in datasheet view.

  3. Try to update a column in this datasheet.

The following error occurs:

   ODBC - Call Failed.
   [Microsoft][ODBC SQL Server Driver]Invalid Parameter number


KBCategory: kbusage
KBSubcategory:

Additional reference words: 1.00 SQLSetParam S1093



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: September 9, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.