I have an Informix stored procedure that needs 4 parameters: whse (3), cust (6), begin date & end date. I suspect the dates are giving me problems. When using the .Parameter with ADO how should I be defining the date? I have the #'s around them but do I need something else? Nowhere can I find any examples. Here is my code:
Set cn = New ADODB.Connection
Set cmdFullPallet = New ADODB.Command
cn.Open "mydsn"
cmdFullPallet.CommandText = "fullpallet"
cmdFullPallet.CommandType = adCmdStoredProc
Set prmWhse = cmdFullPallet.CreateParameter("warehouse", adChar, adParamInput, 3)
cmdFullPallet.Parameters.Append prmWhse
prmWhse.Value = "410"
Set prmCust = cmdFullPallet.CreateParameter("customer", adChar, adParamInput, 6)
cmdFullPallet.Parameters.Append prmCust
prmCust.Value = "1414"
Set prmBeginDate = cmdFullPallet.CreateParameter("begin_date", adDate, adParamInput)
cmdFullPallet.Parameters.Append prmBeginDate
prmBeginDate.Value = #1/1/2002#
Set prmEndDate = cmdFullPallet.CreateParameter("end_date", adDate, adParamInput)
cmdFullPallet.Parameters.Append prmEndDate
prmEndDate.Value = #5/21/2002#
cmdFullPallet.ActiveConnection = cn
cmdFullPallet.Execute
Any suggestions? Thanks.
Set cn = New ADODB.Connection
Set cmdFullPallet = New ADODB.Command
cn.Open "mydsn"
cmdFullPallet.CommandText = "fullpallet"
cmdFullPallet.CommandType = adCmdStoredProc
Set prmWhse = cmdFullPallet.CreateParameter("warehouse", adChar, adParamInput, 3)
cmdFullPallet.Parameters.Append prmWhse
prmWhse.Value = "410"
Set prmCust = cmdFullPallet.CreateParameter("customer", adChar, adParamInput, 6)
cmdFullPallet.Parameters.Append prmCust
prmCust.Value = "1414"
Set prmBeginDate = cmdFullPallet.CreateParameter("begin_date", adDate, adParamInput)
cmdFullPallet.Parameters.Append prmBeginDate
prmBeginDate.Value = #1/1/2002#
Set prmEndDate = cmdFullPallet.CreateParameter("end_date", adDate, adParamInput)
cmdFullPallet.Parameters.Append prmEndDate
prmEndDate.Value = #5/21/2002#
cmdFullPallet.ActiveConnection = cn
cmdFullPallet.Execute
Any suggestions? Thanks.