Microsoft KB Archive/131382

= PRB: STINYINT Data Type Not Supported in Access Driver =

Article ID: 131382

Article Last Modified on 6/12/2001

-

APPLIES TO


 * Microsoft Open Database Connectivity 2.0

-



This article was previously published under Q131382



BUG# QJet: 1666 (2.00.2317)



SYMPTOMS
The Microsoft Access driver version 2.00.2317 returns the following error when a parameter is bound from SQL_C_STINYINT to any SQL data type:

Invalid string or buffer length

When the parameter markers are used to insert or update rows and a call to SQLBindParameter binds a SQL_C_STINYINT to any SQL data type, the insert or update fails. SQL_C_STINYINT is an extended C data type that corresponds to a 'Signed Char' C type. The ODBC version 2.0 "Programmer's Reference" states that SQL_C_STINYINT is converted to SQL_TINYINT by default and a host of other conversions are supported.



CAUSE
The problem arises because the Jet engine does not support a 'Signed TinyInt' data type. Jet is Microsoft's database engine on which the Access driver relies for its data processing. However, the driver returns the above error when it should return the error:

Driver not capable



WORKAROUND
The workaround is to use a SQL_C_SHORT or some other data type instead of a SQL_C_STINYINT.



STATUS
Microsoft has confirmed this to be a problem in 16- and 32-bit ODBC Access driver version 2.00.2317. We are researching this problem and will post additional information here in Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The following code would produce the error: SQLExecDirect(hstmt1,"create table oof (col1 integer)",SQL_NTS) SQLBindParameter(hstmt1,1,SQL_PARAM_INPUT,SQL_C_STINYINT,SQL_INTEGER,0,0,5, 0, 0) SQLExecDirect(hstmt1,"insert into oof values(?)",SQL_NTS) The last call would return a SQL state S1090, native error 62, and the following message when a SQL_SUCCESS is expected:

Invalid string or buffer length

Additional query words: 2.002317 ODBC Access MFC Database Classes Windows NT WFW 3.11 3.10

Keywords: kbprb KB131382

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.