Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing stored procedure from asp Page

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a stored procedure that expects 1 parameter on sql server that I want to call from an asp page, I have typed the following code:
Set rsloop = Server.CreateObject("ADODB.Recordset")
dim com
set com=server.CreateObject("adodb.command")
set para=com.CreateParameter("param",adVarChar,adParamInput,20) 'line XX com.Parameters.append para
com.Parameters("param")="3/11/1999"
with com
.ActiveConnection =objdbConnection
.CommandText ="procgenTestNber"
.CommandType =adCmdStoredProc
end with
set rsloop = com.Execute
I get the following error when the page loads:
ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

The error points to the line that i have marked as line XX
I will apprecite your help.
 
Try casting the date before assigning it:

com.Parameters("param")=CDATE("3/11/1999")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top