I've read the threads about how to call stored procedures within access vba and I took an example and tried to make it work for me. However, I keep getting errors messages. I'm hoping an expert can sort me out.
Here's my code:
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "sp_getMasterFileForPDF "
.Parameters.Append .CreateParameter("@PDFname", adVarChar, adParamInput, 200, PDF_NAME)
I get the following error message when i try to run the code:
The Microsoft Jet database engine cannot find the input table or query 'sp_getMasterFileForPDF'. Make sure it exists and that its name is spelled correctly.
However, if I add a dot before my stored precudre name (".sp_getMasterFileForPDF"
) then I get the following error:
Expected query name after EXECUTE.
I've never tried calling a stored procedure before, so I am very new to the concept. Any help is appreciated.