Maybe I am missing something completely obvious but as far as I can tell I aren't!
I am trying to simply pass a parameter to a stored proc to return results. Easy So I thought so too...
This is my stored procedure below (in it's ALTER PROCEDURE form):
ALTER
PROCEDURE [dbo].[spd_Tester] -- Add the parameters for the stored procedure here@Check
intAS
BEGIN
SELECT * FROM tblPerson WHERE PersonID = @CheckEND
Now I know this is a SQL Server forum but I figure anyone who reads this probably does some application programming as well, so here is the code that calls this. It's in VBA using Access 2003. I figure the error is being returned from SQL Server Express so that's why I have come to this forum instead of an Access forum! I could be wrong though...
Here is the code that calls this:
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
'Run sql command
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandText = "dbo.spd_Tester"
.Parameters.Append .CreateParameter("@Check", adInteger, adParamInput, , Me.txtFirstName)
'Execute, return recordset
Set rs = .Execute
End With
Now I figure this should work. However, I get the error "Procedure or function 'spd_Tester' expects parameter '@Check', which was not supplied." when I execute the procedure with the number 1 in the txtFirstName text box.
Can someone tell me what I am doing wrong The tblPerson table has data in it, if I run the select from a query window, specifying a value for @Check, it works just fine.
Thanks in advance!