Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Procedure 'spxx' expects parameter '@xx'

    Hi All,
    I hope someone can figure this one out. it's driving me nuts. I'm using SQL 2000, Visual InterDev 6.0 and am using vbscript in my .asp pages.
    I have 2 projects, each with very similar coding (attached). 1 works just fine while the other gives the following error message:
    ***Procedure 'spInsertParticipant' expects parameter '@SignInName', which was not supplied.***
    I cannot figure out why 1 works and the other doesn't. As far as I can tell, both db's are set up identically with permissions, on the same SQL server, developed on the same machine, etc.
    I'm just beginning to use SQL Server along with ASP to develop db's online; very beginning. From what limited knowledge I have I can not tell what differences, if any, the 2 projects have.
    If any other info is needed please do not hesitate to ask. I've been bouncing on this for 3 days now. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>
    Thank you.

    gdr
    Attached Files Attached Files
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    There's something unconventional about the spelling on the second line...

    .Parameters.append .CreateParameter ("@SignInName",adVarChar _
    ,adParamInput,8,sCurretnUser)

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15> Sorry, that was a dyslexic fingered keystroke. No it doesn't work with sCurrentUser either, or when I place that value into a text box on the submitting page and try and use it in the parameter statement as Request.Form("txtSignInName")). I know the value is being submitted as I can do a Response.Write and return it. Also I am using an htm entry form which posts its data to an asp page which has the attached parameter code
    Thank You.

    gdr
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    Okay, I read it again. Are you sure this item exists in the Contents collection?

    sCurrentUser = Session("currentuser")

    Are you saying that if you change this to a string, e.g.,

    sCurrentUser = "Joe Blow"

    you still get the error?

    I have never tried to do what you're doing. I use the more simple-minded technique of creating a recordset on the table, using .AddNew, assigning field values, and then adding the record to the database using .Update. Partly this is because I learned ADO using Access MDB files, but partly this is because the process you're using seems needlessly complex. So... hopefully someone else can help more.

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    Hi Gary,

    Jefferson is spot on with his suggestion - try to isolate the problem. Assuming your stored procedure works properly, try manually adding your parameters (i.e. assign them directly rather than pulling from session or form variables).

    Also, I seem to remember from a while back that you have to add a return or output parameter to the command object BEFORE any input parameters. I see that you're using raiserror to catch exceptions. I wonder if the SP is generating that error and trying to send the error back to ASP with the first parameter, therefore shifting all parameters down by one... (Forgive me if this is reaching a bit... I haven't worked with this for a few months.)

    By the way, your ASP and SQL code are both very well written! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

  6. #6
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    Thanks Jefferson and Mark,
    So I tried setting sCurrentUser = "guest" and still got the error message. I added Set NoCount On (after the AS statement), and still got the message. So it seems to me that my "handling" page is not communicating with the stored procedure. I know the value is there as I have the following in the body of that "handling" page and the proper values for Session("currentuser") and sCurrentUser are returned.

    <pre><BODY>

    <%

    if Err.number = 0 then
    Response.Write "Success!"
    else
    Response.Write "No go!"
    Response.Write Err.description & ""
    Response.Write(Session("currentuser")) & ""
    Response.Write sCurrentUser
    end if
    %>
    </BODY>
    </pre>


    Thanks again for your help.

    gdr
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    There's a tiny difference between the two procedures: the first parameter in the one that isn't working is of type adVarChar (SQL Server varchar), while the first parameter in the one that is working is adChar (SQL Server char). On the off chance that you're encountering a type conversion error going from a variant (of type string) to SQL Server varchar, try this:

    .Parameters.append .CreateParameter ("@SignInName",adVarChar _
    ,adParamInput,8,CStr(sCurrentUser))

  8. #8
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Procedure 'spxx' expects parameter '@xx'

    Sorry I couldn't get back to this earlier than now.
    Thanks, but sorry no go and no luck yet.

    gdr
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

Posting Permissions

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