chobo321321
Registered User.
- Local time
- Today, 10:41
- Joined
- Dec 19, 2004
- Messages
- 53
Hi, I am trying to execute a stored procedure that take in 1 (datetime) parameter. Everytime I try and execute it I get the following error, which makes no sense to me.
"Procedure 'Shipping' expects parameter '@ShipDate, which was not supplied.
Any help is appreciated, thanks.
Here is the code for the form:
I'll also post the stored procedure code. The procedure byitself works fine.
"Procedure 'Shipping' expects parameter '@ShipDate, which was not supplied.
Any help is appreciated, thanks.
Here is the code for the form:
Code:
Private Sub cmdShippers_Click()
Dim rst As New ADODB.Recordset
Dim par As New ADODB.Parameter
Dim cmd As New ADODB.Command
Dim datShipDate As Date
cmd.ActiveConnection = CurrentProject.Connection
datShipDate = txtShipDate
With cmd
.CommandText = "Shipping"
.CommandType = adCmdStoredProc
Set par = .CreateParameter("@ShipDate", adDBTimeStamp, adParamInput, datShipDate)
.Parameters.Append par
End With
cmd.Execute
'ShowRecordset rst
End Sub
I'll also post the stored procedure code. The procedure byitself works fine.
Code:
create Procedure Shipping
(
@ShipDate Datetime
)
as
SELECT datepart(weekday, o.shipdate) as 'Week Day'
FROM tblOrder o
Where o.shipdate is not null and
o.shipdate = CONVERT(DATETIME, @ShipDate, 101)
exec Shipping '03/22/2004'