-
Hi,
i have a Stored Procedure (Query) in Access 2000 and I am trying to find out how many parameters it requires.
For SQL Server I've always used this:
Code:
CN.CursorLocation = adUseClient
CMD.CommandType = adCmdStoredProc
CMD.ActiveConnection = CN
CMD.CommandText = SPName
' returns parameter type from sp
CMD.Parameters.Refresh
' Param 0 is RETURN_VALUE
For I = 1 To CMD.Parameters.Count - 1
Set Param = CMD.Parameters(I)
DebugString = DebugString & Param.Name & " " &
Param.Type & vbCrLf
Param.Value = Args(I - 1) 'Args is passed in through sub
Next
'Run Stored procedure
Set RunStoredProc = CMD.Execute
For some reason, when I do Parameters.Refresh it always has a count of 0, yet when I execute the command, VB keeps raising an error saying that it requires 3 parameters. (which I know to be true).
So how can I get the number of parameters required by my stored procedure?
Thanks
Totally :confused:
-
Some Databases don't accept Stored Procedures or allow Paramaterised Queries to return paramaters using the refresh method. Access is one of them I think.
I would be interested to hear if anybody else has any suggestions on how to solve this problem! :)
Shaun