Here is my another problem.
I need to check Database for multiple records. To do that
I created code like that
For some reason I keep getting Error like "procedure has too many arguments specified" when program is going second times through the loop. Seems to me something (I thing .Parameters) must be refreshed after every lap in loop. I tried to use .Refresh/Delete methods but it did not help. Thakx a lot for any help/advisw
I need to check Database for multiple records. To do that
I created code like that
Code:
With cmdReport
.ActiveConnection = cnReport
.CommandType = adCmdStoredProc
.CommandText = strSP_name
If Mid(strSP_name, 16, 2) = "AK" Then
For i = 0 To lstClients.ListCount - 1
.Parameters.Append .CreateParameter("@stDate", adVarChar, adParamInput, 10, strToday)
.Parameters.Append .CreateParameter("@client", adVarChar, adParamInput, 10, lstClients.List(i))
Set rsReport = .Execute
'some other code not related with SQL
Next
End if
End with
For some reason I keep getting Error like "procedure has too many arguments specified" when program is going second times through the loop. Seems to me something (I thing .Parameters) must be refreshed after every lap in loop. I tried to use .Refresh/Delete methods but it did not help. Thakx a lot for any help/advisw