I am using MS Access 2000, in VB 6 I have written the following code using ADO 2.0 to pass the value of date as parameter to the Access Query but it is giving me error "type mismatch" even if I don't use the "#" sign for the date. Anyone help me pls
Dim cmd As New ADODB.Command
Dim ParamItem As Parameter
Dim strSQL As String
strSQL = "SELECT tblSales.broker_id, tblSales.total_amount, tblSales.curent_date"
strSQL = strSQL & " FROM tblSales"
strSQL = strSQL & " WHERE (((tblSales.curent_date)=?));"
cmd.ActiveConnection = strCon
cmd.CommandText = "qryTest"
cmd.CommandType = adCmdTable
Set ParamItem = cmd.CreateParameter("dtmDate", adDate, adParamInput, "#5/2/03#")
cmd.Parameters.Append ParamItem
cmd.Execute
Set cmd = Nothing
Set ParamItem = Nothing