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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure problem

Status
Not open for further replies.

nooshin72

MIS
Joined
Jan 14, 2004
Messages
6
Location
IR
I am using asp with sql database
This is my stored procedure
set myconn=server.CreateObject("ADODB.connection")
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = myconn
cmd.CommandText = "Min_ProgId"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("RecDate",adchar,adParamInput)
cmd.Parameters("RecDate").Value=ObjDate
set rst=cmd.Execute
Response.Write(rst("ProgId"))

and this is my Stored Prcedure
CREATE PROCEDURE dbo.Min_ProgId @RecDate char(15) AS

select ProgId from TblTotal Where convert(smalldatetime,Fromtime ,14)=(select Min(convert(smalldatetime,Fromtime ,114)) as Min_Fld from TblTotal Where ObjDate=@RecDate)

I need to pass the parameter ro stored procedure. but i get this error
"Error Type:
ADODB.Command (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal"

The way i am calling stored procedure is what the microsoft has told. and also if i execute the stored procedure without passign a parameter to it , it works fine. but i need to pass a parameter RecDate to it, where is the problem, please help me?
Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top