sql server programming:
Hi
I want to know how can i Pass tow Dates to Stored Procedure in sql server
2000 by using vb6.
here below my code i used northwind database ,when i run the code i got
error in the cmd.excute .
i thing my problem in passing date, can any when tell me what is the problem
Private Sub Command2_Click()
Call connect
Call setup
Dim cmd As New ADODB.Command
cmd.ActiveConnection = Con
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "Employee Sales by Country"
Dim parm As New ADODB.Parameter
Dim parm2 As New ADODB.Parameter
Set parm = cmd.CreateParameter("ShippedDate", adDate, adParamInput, ,
"01/01/1997")
Set parm2 = cmd.CreateParameter("ShippedDate", adDate, adParamInput, ,
"01/01/2005")
cmd.Parameters.Append parm
cmd.Parameters.Append parm2
Dim RST As New ADODB.Recordset
Set RST = cmd.Execute
Set DataGrid1.DataSource = RST
DataGrid1.ReBind
End Sub