Pass image to SQL Stored Procedure

B

Bent Kjeldsen

Hi.

I would like to upload an image (got File.Binary from ASPUpload) with a
stored procedure.

It works with a normal recordset with new/update and in ASP.NET, but in
Classic ASP, I can't find the right constant in adovbs.inc to use for the
parameter:

Command.Parameters.Append Command.CreateParameter("@FileBlob", ?????,
adParamInput, , File.Binary)

Anyone?

Thanks

Bent
Denmark
 
J

John Scragg

I would guess that it expects a varbinary, but why not let the database tell you what it needs

After you set up your command, use Command.Parameters.Refresh to let ADO query the database for the data types. Then either put in a break point and evaluate the Command.Parameters("@FileBlob").Type to see what ADO came up with

..Refresh has a performance penalt, so once you know the type you can take the .Refresh and evaluation code out and har code in your type

Hope that helps
Joh


----- Bent Kjeldsen wrote: ----

Hi

I would like to upload an image (got File.Binary from ASPUpload) with
stored procedure

It works with a normal recordset with new/update and in ASP.NET, but i
Classic ASP, I can't find the right constant in adovbs.inc to use for th
parameter

Command.Parameters.Append Command.CreateParameter("@FileBlob", ?????
adParamInput, , File.Binary

Anyone

Thank

Ben
Denmar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top