[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Getting Error in Stored Procedure uisng asp

Posted on 2011-05-12
11
Medium Priority
?
637 Views
Last Modified: 2013-12-05
Hello . M getting error when  in my asp file
Erro is : Description:Parameter object is improperly defined. Inconsistent or incomplete information was provided.

and mine code are :

<%
Set cn = Server.CreateObject("ADODB.Connection")
      cn.ConnectionString = ConnectionString()
    cn.open
      
      Set rs = Server.CreateObject("ADODB.Recordset")


    set cmd = server.CreateObject("ADODB.command")
      cmd.ActiveConnection = LFConnectionString()
      cmd.CommandType = adcmdstoredproc
      cmd.CommandText = "sp_qsurv_individual"
      cmd.Parameters.append = cmd.CreateParameter ("@Id",adInteger,adParamInput,4,ID)
      cmd.Parameters.append = cmd.CreateParameter ("@Username",adVarchar,adParamInput,16,UserName)
      cmd.Parameters.append = cmd.CreateParameter ("@Orientation",adChar,adParamInput,1,Orientation)
      cmd.Parameters.append = cmd.CreateParameter ("@DOB",adSmallDatetime,adParamInput,4,DOB)
      cmd.Parameters.append = cmd.CreateParameter ("@Country",adChar,adParamInput,2,Country)
      cmd.Parameters.append = cmd.CreateParameter ("@County",adChar,adParamInput,2,County)
      cmd.Parameters.append = cmd.CreateParameter ("@Postcode",adVarchar,adParamInput,8,Postcode)
      cmd.Parameters.append = cmd.CreateParameter ("@Smokes",adVarchar,adParamInput,1,Smokes)
      cmd.Parameters.append = cmd.CreateParameter ("@Religion",adChar,adParamInput,1,Religion)
      cmd.Parameters.append = cmd.CreateParameter ("@Politics",adVarchar,adParamInput,1,Politics)
      cmd.Parameters.append = cmd.CreateParameter ("@MaritalStatus",adVarchar,adParamInput,1,MaritalStatus)
      cmd.Parameters.append = cmd.CreateParameter ("@Education",adChar,adParamInput,1,Education)
      cmd.Parameters.append = cmd.CreateParameter ("@Gender",adChar,adParamInput,1,Gender)
      cmd.Parameters.append = cmd.CreateParameter ("@Starsign",adChar,adParamInput,1,Starsign)
      
      
      
      
      
      set rs = cmd.Execute()

    If not(rs.EOF=true or rs.BOF=true) then
       response.Write("TEST")
    Else
       
    End If
     CloseConnection LFConnectionString()
      
      
      
%>


PLEASE HELP ME WITH THIS
0
Comment
Question by:highlander_1969
9 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 672 total points
ID: 35745134
These are all input paramerets then you need to provide the values also for each
0
 
LVL 11

Assisted Solution

by:JoeNuvo
JoeNuvo earned 664 total points
ID: 35745261
check your parameter datatype with the one define in stored procedure sp_qsurv_individual

1. if stored procedure expecting number, but you define it as adChar/adVarChar, it will raise that error.
2. I think there is no adSmallDateTime, try change it to adDate
0
 

Author Comment

by:highlander_1969
ID: 35745376
Okk now the error is gone....

Now m getting this type of error..

Description:[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'sp_qsurv_individual' expects parameter '@Id', which was not supplied.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 9

Assisted Solution

by:anillucky31
anillucky31 earned 664 total points
ID: 35745509
in this cmd.Parameters.append = cmd.CreateParameter ("@Id",adInteger,adParamInput,4,ID)

See the value of ID. If it is blank then it will give this error
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 35745574
Please use number 4 instead "adcmdstoredproc "
0
 

Author Comment

by:highlander_1969
ID: 35745628
Thanks everyone.... got the solution..
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 35756430
And the solution was .... ?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37101719
I would recomment deleting.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 37163460
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

834 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