Professional Web Applications Themes

OLE DB Error - Microsoft SQL / MS SQL Server

You have the wrong parameter type: cmd.Parameters.Append cmd.CreateParameter ("imgID", adInteger, adParamOutput) -- Tom --------------------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinnaclepublishing.com/sql "Rob Malvisi" <ltd.uk> wrote in message news:0c7801c35c2f$2f355af0$gbl... I am trying to access a stored procedure using vbscript under asp, and it keeps returning an error message: Microsoft OLE DB Provider for SQL Server error '80040e14' Formal parameter 'imgID' was defined as OUTPUT but the actual parameter not declared OUTPUT. The stored procedure is defined as follows: CREATE PROCEDURE sp_add_img ( imgID int OUTPUT, userID int, imgType int, imgBlob ...

  1. #1

    Default Re: OLE DB Error

    You have the wrong parameter type:

    cmd.Parameters.Append cmd.CreateParameter
    ("imgID", adInteger, adParamOutput)


    --
    Tom

    ---------------------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Columnist, SQL Server Professional
    Toronto, ON Canada
    www.pinnaclepublishing.com/sql


    "Rob Malvisi" <ltd.uk> wrote in message news:0c7801c35c2f$2f355af0$gbl...
    I am trying to access a stored procedure using vbscript
    under asp, and it keeps returning an error message:

    Microsoft OLE DB Provider for SQL Server error '80040e14'

    Formal parameter 'imgID' was defined as OUTPUT but the
    actual parameter not declared OUTPUT.

    The stored procedure is defined as follows:

    CREATE PROCEDURE sp_add_img (
    imgID int OUTPUT,
    userID int,
    imgType int,
    imgBlob binary(4000),
    binaryEdit varchar(2016)
    )

    AS

    INSERT INTO tbl_member_pictures (

    userID,
    imgType,
    imgBlob,
    binaryEdit

    )
    VALUES (

    userID,
    imgType,
    imgBlob,
    binaryEdit
    )

    SELECT imgID = identity
    GO

    The table tbl_member_pictures is defined as follows:

    CREATE TABLE [dbo].[tbl_member_pictures] (
    [imgID] [int] IDENTITY (1, 1) NOT NULL ,
    [imgType] [int] NULL ,
    [userID] [int] NOT NULL ,
    [imgBlob] [binary] (4000) NULL ,
    [binaryEdit] [char] (2016) COLLATE
    SQL_Latin1_General_CP1_CI_AS NULL ,
    [lastMod] [datetime] NULL

    And the vbscript I am using is:

    cmd.CommandText = "{call sp_add_img(?,?,?,?,?)}"
    cmd.Parameters.Append cmd.CreateParameter
    ("imgID", adInteger, adParamReturnValue)
    cmd.Parameters.Append cmd.CreateParameter
    ("userID", adInteger, adParamInput)
    cmd.Parameters.Append cmd.CreateParameter
    ("imgType", adInteger, adParamInput)
    cmd.Parameters.Append cmd.CreateParameter
    ("imgBlob", adVarBinary, adParamInput, 4000)
    cmd.Parameters.Append cmd.CreateParameter
    ("binaryEdit", adVarWChar, adParamInput, 2016)
    cmd.Parameters("userID") = user_id
    cmd.Parameters("imgType") = imgType
    cmd.Parameters("imgBlob") = Imageblob
    cmd.Parameters("binaryEdit") = binaryEdit
    cmd.Execute

    imgID = cmd("imgID")


    Really starting to pull my hair out on this one! Any help
    would be most appreciated..

    Tom Guest

  2. #2

    Default Re: OLE DB Error

    Try to put SET NOCOUNT ON.

    HTH

    Juliana

    "Rob Malvisi" <ltd.uk> wrote in message
    news:0c7801c35c2f$2f355af0$gbl... 


    Juliana Guest

  3. #3

    Default Re: OLE DB Error

    Many thanks for the help, but unfortunately it did not work. I have
    modified the vbscript to read:

    cmd.Parameters.Append cmd.CreateParameter("imgID", adInteger,
    adParamOutput)

    where adParamOutput is declared as:

    Const adParamOutput = &H0002

    It returns the same error message. Any further ideas??



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Rob Guest

  4. #4

    Default Re: OLE DB Error

    Thanks for the suggestion, unfortunately this did not eliminate the
    error either. What else could I try??

    Cheers.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Rob Guest

  5. #5

    Default Re: OLE DB Error

    Try:

    cmd.CommandText = "sp_add_img"

    --
    Tom

    ---------------------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Columnist, SQL Server Professional
    Toronto, ON Canada
    www.pinnaclepublishing.com/sql


    "Rob Malvisi" <ltd.uk> wrote in message news:phx.gbl...
    Many thanks for the help, but unfortunately it did not work. I have
    modified the vbscript to read:

    cmd.Parameters.Append cmd.CreateParameter("imgID", adInteger,
    adParamOutput)

    where adParamOutput is declared as:

    Const adParamOutput = &H0002

    It returns the same error message. Any further ideas??



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Tom Guest

  6. #6

    Default Re: OLE DB Error

    Tom,

    Thanks for the further help. I've just solved the problem, my stupid
    error in the sp. Thread closed.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Rob Guest

Similar Threads

  1. Replies: 0
    Last Post: March 29th, 09:49 PM
  2. Replies: 0
    Last Post: November 10th, 05:24 PM
  3. Postscript Print error (ERROR: rangecheck; OFFENDING COMMAND: filter)
    By Darrell_J_Brown@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: May 13th, 11:24 AM
  4. Replies: 1
    Last Post: August 7th, 07:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139