Pass image to SQL Stored Procedure

Discussion in 'ASP General' started by Bent Kjeldsen, Feb 23, 2004.

  1. 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
     
    Bent Kjeldsen, Feb 23, 2004
    #1
    1. Advertising

  2. Bent Kjeldsen

    John Scragg Guest

    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
     
    John Scragg, Feb 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike P
    Replies:
    0
    Views:
    3,328
    Mike P
    Jun 19, 2006
  2. Replies:
    2
    Views:
    617
    =?Utf-8?B?TXVoYW1tYWQgTW9zYQ==?=
    Oct 7, 2006
  3. Replies:
    2
    Views:
    4,393
  4. Machelle Chandler

    Using query string to pass a value to a stored procedure parameter

    Machelle Chandler, Oct 21, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    178
    Machelle Chandler
    Oct 21, 2003
  5. Mike Lopez

    Pass a Date to stored procedure

    Mike Lopez, Jan 25, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    119
    Mike Lopez
    Jan 25, 2005
Loading...

Share This Page