Article ID: 132960
Article Last Modified on 11/21/2006
APPLIES TO
- Microsoft Foundation Class Library 4.2, when used with:
- Microsoft Visual C++ 1.5 Professional Edition
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52 Professional Edition
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q132960
SYMPTOMS
Parameterizing a recordset using one or more character fields may result
in an error message similar to the following being returned by an ODBC
driver:
Invalid precision value
State:S1104,Native:76,Origin:[Microsoft][ODBC dBase Driver]
CAUSE
If 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.
RESOLUTION
To 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:
pFX->SetFieldType(CFieldExchange::param);
RFX_Text(pFX, "FIELD1Param", m_strFIELD1Param, 8);
REFERENCES
For 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 kbprb KB132960