[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Error in Parameters

Posted on 1999-11-27
5
Medium Priority
?
1,104 Views
Last Modified: 2012-06-21
I'm getting the following error when executing the the following asp code. Your help is highly appreciated.

ADODB.Parameters error '800a0e7c'

The application has improperly defined a Parameter object.

/Lab_Local/Lab/Login.asp, line 34

(I have marked line no 34 below)

<%
    ' Verify the user and get user profile from sql server
      
      ' Create ADO connection
      Set cn = Server.CreateObject("ADODB.Connection")
      
      ' DSN is used to access sqlserver.
      cn.Open "DSN", "User", "Pwd"
      
      Set cmd = Server.CreateObject("ADODB.Command")
      cmd.ActiveConnection = cn
   
   ' Define the stored procedure's inputs and outputs
   ' Question marks act as placeholders for each parameter for the
   ' stored procedure  
     
    cmd.CommandText = "{call gsp_Login_1(?,?,?,?,?,?)}"
      cmd.CommandType = adCmdStoredProc
            
      ' Create input/output params
      Set CmdParam = cmd.CreateParameter ("UserID", adChar, adParamInput)
      cmd.Parameters.Append CmdParam <= this is "Line No 34"
      
      cmd.Parameters.Append cmd.CreateParameter("Password", adChar, adParamInput)
      cmd.Parameters.Append cmd.CreateParameter("VUser", adInteger, adParamOutput)
      cmd.Parameters.Append cmd.CreateParameter("LoggedIn", adInteger, adParamOutput)
      cmd.Parameters.Append cmd.CreateParameter("VersionNo", adInteger, adParamOutput)
      cmd.Parameters.Append cmd.CreateParameter("UserIPAddr", adChar, adParamInput)
      
      ' Set values for input params
      cmd.Parameters("UserId") = Request.Form("text_UserID")
      cmd.Parameters("Password") = Request.Form("text_Password")
      cmd.Parameters("UserIPAddr") = Request.ServerVariables("REMOTE_HOST") ' IP address
   
    ' do the work
    cmd.Execute
   
    IF cmd("VUser") = 0 Then
            Response.Write "Invalid UserID/Password"
      Else ' Valid user
            IF cmd("LoggedIn") = 1 Then
                  Response.Write "User already logged in"
            Else
                  ' Valid user
                  Response.Write Redirect page...
            End If
      End If
   %>
0
Comment
Question by:mm2
5 Comments
 

Author Comment

by:mm2
ID: 2238209
Edited text of question.
0
 

Author Comment

by:mm2
ID: 2238211
Edited text of question.
0
 
LVL 3

Expert Comment

by:manojamin
ID: 2238227
0
 
LVL 7

Accepted Solution

by:
deepaklakhani earned 200 total points
ID: 2261470
for creating parameters of character type, u need to specify an additional parameter (i.e. size ) to createparameter method.

add size parameter at the end of createparameter method as below

Set CmdParam = cmd.CreateParameter ("UserID", adChar, adParamInput , 30)
cmd.Parameters.Append CmdParam
cmd.Parameters.Append cmd.CreateParameter("Password", adChar, adParamInput, 30)
cmd.CreateParameter("UserIPAddr", adChar, adParamInput , 30)

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6833369
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed.  Also a question is posted there specific to these changes that apply to the experts here.  Also, I am including the link to our All Topics, since many new ones have recently been added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question