PRB: Passing vtMissing as Output Parameter to ADO Function Gives Error (295692)
The information in this article applies to:
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- Microsoft Visual C++, 32-bit Editions 6.0
- Microsoft Visual J++ 6.0
This article was previously published under Q295692 SYMPTOMS
When you pass a reference of vtMissing as an output parameter to an ActiveX Data Objects (ADO) function from Visual C++ or Visual J++, you may receive the following error:
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
CAUSE
Although vtMissing is a Variant value that is initialized to DISP_E_PARAMNOTFOUND, ADO does not treat this Variant value as optional, and actually modifies the value. Because vtMissing is a global variable, if you subsequently use vtMissing in another function, you will get unexpected results.
RESOLUTION
To resolve this problem, do not pass the reference of vtMissing to any ADO function as an output parameter. For example, if you have this line of code
conn->Execute( "Some SQL Statement", &vtMissing, adCmdText );
you can change it to the following:
conn->Execute( "Some SQL Statement", NULL, adCmdText );
STATUS
This behavior is by design.
REFERENCES
For additional information, see the ADO documentation for Command::Execute and Connection::Execute.
Modification Type: | Major | Last Reviewed: | 8/23/2001 |
---|
Keywords: | kbDSupport kbprb KB295692 |
---|
|