Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Question Unanswered: stored Procedure

    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("RecDate") = ObjDate
    set rst=cmd.Execute

    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.Parameters (0x800A0E7C)
    Parameter object is improperly defined. Inconsistent or incomplete information was provided."

    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
    Last edited by nnmmss; 02-21-04 at 08:14.

  2. #2
    Join Date
    Dec 2003
    Set myconn=Server.CreateObject("ADODB.connection")
    myconn.ConnectionString = ? /* ? is a connection string */
    Set cmd = Server.CreateObject("ADODB.Command")
    Set cmd.ActiveConnection = myconn
    cmd.CommandType = adCmdStoredProc
    cmd.CommandText = "Min_ProgId"
    cmd.CreateParameter("RecDate",adchar,adParamInput, 15, ObjDate)
    cmd.CreateParameter("ProgId",adInteger,adParamOutp ut)
    Set rst = cmd.Execute

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts