The information in this article applies to:
SYMPTOMSParameterizing a recordset using one or more character fields may result in an error message similar to the following being returned by an ODBC driver:
CAUSEIf an application does not specify the maximum length of a character field parameter in the recordset's DoFieldExchange() function, a default value of 255 is used. Some data sources have a maximum character field length of less than 255. RESOLUTIONTo resolve this issue, include a fourth parameter in the RFX_Text() function call equal to the size of the character field that is being bound. For example, to bind a parameter to an eight-character field in a database, call the RFX_Text() function as follows:
MORE INFORMATIONThe exception being thrown is generated in the RFX_Text() function by the following code:
The ODBC Programmer[ASCII 146]s Reference states the following for the
SQLBindParameter() S1104 error:
If no nMaxLength is passed into the RFX_Text(), nMaxLength defaults to 255. If the data source does not support text fields of 255, the S1104 error occurs. The Microsoft dBASE and FoxPro drivers, for example, have a maximum character field length of 254. They exhibit the behavior described in this article. REFERENCESFor more information, please see SQLBindParameter in the ODBC 2.x Programmer's Reference. Additional query words: kbvc200 kbvc210 kbvc220 kbvc400 kbvc410 kbvc42 kbvc500 kbvc600
Keywords : kberrmsg kbinterop kbDatabase kbMFC kbODBC kbVC |
Last Reviewed: July 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |