I'm new to stored procedures and I'm having no luck passing a date parameter to my stored proc. Please HELP!!!
Here is my VB code:
DDate is the date that I'm trying to pass.
Set cmd = New Command
cmd.ActiveConnection = "RenewalsServer"
cmd.CommandText = "NoAnswerTest"
cmd.CommandType = adCmdStoredProc
Set param = cmd.CreateParameter("AcctNum", adDouble, adParamInput, , Val(AcctNum))
cmd.Parameters.Append param
Set param = cmd.CreateParameter("DDate", adDBTimeStamp, adParamInput, , Val(DDate))
cmd.Parameters.Append param
Set rsado = cmd.Execute
Here is the stored proc:
CREATE PROCEDURE NoAnswerTest
@AcctNum float,
@DDate datetime
AS
Insert Into tblCallBack
([Order],UserId,DDate)
Values
(@AcctNum,0,@DDate )
I get a result of 1/1/1900.
PLEASE HELP
Thanks for any input you may provide!!
Here is my VB code:
DDate is the date that I'm trying to pass.
Set cmd = New Command
cmd.ActiveConnection = "RenewalsServer"
cmd.CommandText = "NoAnswerTest"
cmd.CommandType = adCmdStoredProc
Set param = cmd.CreateParameter("AcctNum", adDouble, adParamInput, , Val(AcctNum))
cmd.Parameters.Append param
Set param = cmd.CreateParameter("DDate", adDBTimeStamp, adParamInput, , Val(DDate))
cmd.Parameters.Append param
Set rsado = cmd.Execute
Here is the stored proc:
CREATE PROCEDURE NoAnswerTest
@AcctNum float,
@DDate datetime
AS
Insert Into tblCallBack
([Order],UserId,DDate)
Values
(@AcctNum,0,@DDate )
I get a result of 1/1/1900.
PLEASE HELP
Thanks for any input you may provide!!