Getting Error in Stored Procedure uisng asp

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
highlander_1969Asked:
Who is Participating?
 
Pratima PharandeCommented:
These are all input paramerets then you need to provide the values also for each
0
 
JoeNuvoCommented:
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
 
highlander_1969Author Commented:
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
anillucky31Commented:
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
 
Alpesh PatelAssistant ConsultantCommented:
Please use number 4 instead "adcmdstoredproc "
0
 
highlander_1969Author Commented:
Thanks everyone.... got the solution..
0
 
Anthony PerkinsCommented:
And the solution was .... ?
0
 
Anthony PerkinsCommented:
I would recomment deleting.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.