PRB: Error Message 3421 Passing a BLOB Argument to a Stored Procedure (190450)
The information in this article applies to:
- ActiveX Data Objects (ADO) 1.5
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.1 SP2
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q190450 SYMPTOMS
When you use the CreateParameter method to pass a Binary Large Object
(BLOB) data to a stored procedure you need to specify the Maximum size of
the data to be passed. However, when specifying the exact size of blob data
the following error is generated when the parameter is actually passed:
Run-time error '3421':
The application is using a value of the wrong type for the current
operation.
RESOLUTION
Add one to the value of Parameter.Size property when passing a BLOB.
In the following example, ImgLen is LOF(<path>\imageFile):
Set ADOprm = ADOCmd.CreateParameter
(, adLongVarBinary, adParamInput, (ImgLen + 1))
REFERENCES
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
180368
HOWTO: Retrieve and Update a SQL Server Text Field Using ADO
MSDN Visual Studio 6.0; search on: "Using Visual InterDev 1.0 to Pass
Parameters to and from Microsoft SQL Server Stored Procedures"
Modification Type: | Minor | Last Reviewed: | 3/2/2005 |
---|
Keywords: | kbBug kbDatabase kbprb kbStoredProc KB190450 |
---|
|