If I use
Code: Select all
DoCmd.OpenStoredProcedure
If I pass the parameters to the stored procedure, it does execute but there are no results returned. While debugging I can see that it there is the same number of records.
Is there something that I am missing or forgetting? It has been a while since I had to do anything with Access/SQL/VBA.
Here is the code I am using on the click event of a command button and the attached file is the stored procedure. Currently for testing the parameters are hard coded.
Code: Select all
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandText = "spPRDT"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@Sdate", adVarChar, adParamInput, 20, "08/01/2014")
.Parameters.Append .CreateParameter("@EDate", adVarChar, adParamInput, 20, "08/31/2014")
.Parameters.Append .CreateParameter("@qryType", adVarChar, adParamInput, 1, "1")
.Parameters.Append .CreateParameter("@qryGroup", adVarChar, adParamInput, 1, "d")
.Execute
End With
Winston