Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 205
below 3.2.9
ADODB.Field error: "Arguments are of the wrong type..."
After installing Windows 2000 service pack 2, some customers are receiving the following ADODB.Field error when attempting to save files over 20-50K to a database with FileUp's SaveAsBlob method (when used through COM+).

ADODB.Field (0x80020009)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

Service Pack 2 introduced a change to the ADODB.Field object which was interfering with FileUp's SaveAsBlob method. Version 3.3 of FileUp has a fix for this issue.

The best solution is to upgrade to the most recent version of FileUp.

If, for some reason, you are not able to upgrade FileUp, we can recommend the following workarounds:

1)If you are not using FileUp transactionally, you can remove the FileUp package from COM+:

- First, stop the web server completely from the MSDOS command prompt:

C:\> Net Stop iisadmin /y

- Un-install the FileUp package in COM+

Open the "Component Services" located via the Control Panel/Administrative Tools. Navigate to the FileUp Package:
/Component Services
/My Computer
/COM+ Applications

Right-click FileUp. Select Delete.

- Register the dll manually:

At the MSDOS prompt, navigate to the directory which contains the dll file, usually c:\Program Files\SoftArtisans\FileUp>


- Restart the webserver: type "net start w3svc"

2) SoftArtisans FileManager (the component which comes bundled free with FileUp) has an ExportToBlob method which works with Win2K service pack 2. You can temporarily save the file to a directory, insert the file into the database with FileManager, and then delete it from the directory.

The following example of this workround is a modification of our "Upload to Database" sample:

'--- Instantiate FileUp
set upl = Server.CreateObject("SoftArtisans.FileUp")

'--- Set the cache path
upl.Path = "c:\temp"

'--- Extract the user's original filename
strFilename = mid(upl.UserFileName, inStrRev(upl.UserFilename, "\")+1)

'--- Create connection object
Set cnBlob = Server.CreateObject("ADODB.Connection")

'--- Open connection
cnBlob.Open "AccessUpload"

'--- Create recordset object
set rsBlob = Server.CreateObject("adodb.recordset")
rsBlob.Open "SimpleBlobTable", cnBlob, 2, 3

'--- For SQL Server Users, use the following line to open the recordset
'--- Make sure you replace:
'--- by your SQL Server name
'--- rsBlob.Open "SimpleBlobTable", "driver={SQL Server};server=;uid=sa;pwd=;database=SQLServerUpload", 2, 3

'--- Add new record

'--- Save the file to directory, with the user's original filename
upl.SaveAs "c:\temporarydirectory\" & strFilename

'--- Instantiate SoftArtisans FileManager
Set oFM = Server.CreateObject("SoftArtisans.FileManager")

'--- Use FileManager's ExportToBlob method to
'--- insert the file into the appropriate recordset column
oFM.ExportToBlob upl.ServerName, rsBlob.Fields("filecol")

'--- Update and close the recordset

'---Delete the file from the temporary directory

'---Clean up
Set rsBlob = Nothing
Set upl = Nothing
Set oFM = Nothing

Created : 1/15/2003 12:00:00 AM (last modified : 1/23/2003 9:19:06 PM)
Rate this article!