PRB: Passing Parameters By Reference to a VB COM Object
Article ID: 197956
Article Last Modified on 3/14/2005
APPLIES TO
- Microsoft Active Server Pages 4.0
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
- Microsoft Internet Information Server 4.0
- Microsoft Internet Information Services 5.0
This article was previously published under Q197956
SYMPTOMS
When passing a parameter to a COM Component's method in Active Server Pages
(ASP), the following error occurs:
Microsoft VBScript runtime error '800a000d' Type mismatch
Or the value stored in the variable passed to the method is not changed.
CAUSE
VBScript will pass parameters to a method by value if the argument's data
type is NOT declared as a variant and the parameter is passed by reference
if the argument's data type is declared as variant by the method.
RESOLUTION
Parameters to be passed by reference to a method should always be declared
as a variant data type by the method, while parameters to be passed by
value can be declared as any type by the method.
STATUS
This behavior is by design.
Keywords: kberrmsg kbcodesnippet kbprb KB197956