Stored Procedure problem

    Date: 07/24/07 (SQL Server)    Keywords: asp, sql

    I'm running classic ASP against SQL Server 8, and trying to execute a stored procedure. It's the 4th in a sequence of them so I know that my code, so far, is accurate. Here's the top part of the SP:

    CREATE PROCEDURE AddUser (
      @statusCodeValueId int,
      @userCategoryCodeValueId int,
      @AddressId int,
      @ContactMeansId int,
      @firstName varchar(25),
      @middleInitial char(1),
      @lastName varchar(25),
      @username varchar(25),
      @password varchar(100),
      @orgnaizationUserBelongsTo varchar(100),
      @title varchar(20),
      @Comments varchar(2000),
      @inactivationReason varchar(1000),
      @isActive bit,
      @Userid int
     )


    This is a legacy SP so I know it works. However, I'm not using complied VB6 like the prior programmer, so this is the first time for me. Here is my codeblock:

    Set spCmd = Server.CreateObject("ADODB.Command")
    With spCmd
    .ActiveConnection = strConn
    .CommandType = adCmdStoredProc
    .CommandText = "AddUser"
    .Parameters.Append .CreateParameter("statusCodeValueId", adInteger, adParamInput, , usrStatus)
    .Parameters.Append .CreateParameter("userCategoryCodeValueId", adInteger, adParamInput, , usrCategory)
    .Parameters.Append .CreateParameter("AddressId", adInteger, adParamInput, , addressID)
    .Parameters.Append .CreateParameter("ContactMeansId", adInteger, adParamInput, , contactMeansID)
    .Parameters.Append .CreateParameter("firstName", adVarChar, adParamInput, 25, usrFirstName)
    .Parameters.Append .CreateParameter("middleInitial", adVarChar, adParamInput, 1, usrMiddleInitial)
    .Parameters.Append .CreateParameter("lastName", adVarChar, adParamInput, 25, usrLastName)
    .Parameters.Append .CreateParameter("username", adVarChar, adParamInput, 25, usrUserId)
    .Parameters.Append .CreateParameter("password", adVarChar, adParamInput, 100, encryptedPW.Fields("password").Value)
    .Parameters.Append .CreateParameter("orgnaizationUserBelongsTo", adVarChar, adParamInput, 100, usrCompany)
    .Parameters.Append .CreateParameter("title", adVarChar, adParamInput, 20, usrTitle)
    .Parameters.Append .CreateParameter("Comments", adLongVarChar, adParamInput, 2000, usrComments)
    .Parameters.Append .CreateParameter("inactivationReason", adLongVarChar, adParamInput, 1000, usrInactiveReason)
    .Parameters.Append .CreateParameter("isActive", adInteger, adParamInput, , usrIsActive)
    .Parameters.Append .CreateParameter("Userid", adInteger, adParamInput, , Session("user_id"))
    End With


    I get this error:

    Procedure 'AddUser' expects parameter '@Comments', which was not supplied.

    You can see the parameter lists are accurate, so I do not know why it can't see that I'm passing it above. Any help would be greatly appreciated.

    Update
    This also occurs in the 'EditUser' procedure as well. Same error, same parameter field.

    Source: http://community.livejournal.com/sqlserver/61512.html

« RIGHT(field, x) || Assigning values to... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home