MichaelaLee
Programmer
Hi Everyone,
I'm having a little problem adding a record that contains 3 smalldatatime fields. I'm getting the following error:
Error converting data type datetime to smalldatetime.
Here is the code:
Set mCommand = New ADODB.Command
mCommand.CommandType = adCmdStoredProc
mCommand.CommandText = "nf_AddOrder"
Set mParam = mCommand.CreateParameter("@OrderId", adInteger, adParamInput)
mParam.Value = nOrderid
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@ProgramId", adVarChar, adParamInput, 10)
mParam.Value = nProgramId
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@OrderDate", adDBTimeStamp, adParamInput)
mParam.Value = nOrderDate
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@RequiredDate", adDBTimeStamp, adParamInput)
mParam.Value = nRequiredDate
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@DeleiveredDate", adDBTimeStamp, adParamInput)
mParam.Value = nDeleiveredDate
mCommand.Parameters.Append mParam
mCommand.ActiveConnection = ado
mCommand.Execute
I get the error as soon the Execute function is called. The fields and the parameters of the stored procedures are declared as SmallDateTime. Has anyone seen this one yet. Thanks for any info.
Michael Lee
I'm having a little problem adding a record that contains 3 smalldatatime fields. I'm getting the following error:
Error converting data type datetime to smalldatetime.
Here is the code:
Set mCommand = New ADODB.Command
mCommand.CommandType = adCmdStoredProc
mCommand.CommandText = "nf_AddOrder"
Set mParam = mCommand.CreateParameter("@OrderId", adInteger, adParamInput)
mParam.Value = nOrderid
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@ProgramId", adVarChar, adParamInput, 10)
mParam.Value = nProgramId
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@OrderDate", adDBTimeStamp, adParamInput)
mParam.Value = nOrderDate
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@RequiredDate", adDBTimeStamp, adParamInput)
mParam.Value = nRequiredDate
mCommand.Parameters.Append mParam
Set mParam = mCommand.CreateParameter("@DeleiveredDate", adDBTimeStamp, adParamInput)
mParam.Value = nDeleiveredDate
mCommand.Parameters.Append mParam
mCommand.ActiveConnection = ado
mCommand.Execute
I get the error as soon the Execute function is called. The fields and the parameters of the stored procedures are declared as SmallDateTime. Has anyone seen this one yet. Thanks for any info.
Michael Lee