Executing a stored SQL Server procedure from Access

I have a stored procedure in SQL Server that performs an update on my tables (no parameters needed and no data returned).  In SQL Server it is called dbo._Test_MissingProjectIDs.

I have created an ADO connection which works fine

I'm having difficulty with the syntax in Access to execute the procedure.  This is where I'm currently at and the resulting error message:


Set qdf = CurrentDb.CreateQueryDef("")
qdf.SQL = "Exec dbo._Test_MissingProjectIDs"
qdf.Execute

on the qdf.sql step I get error 3129: Invalid SQL statement; expecting DELETE, INSERT, PROCEDURE, SELECT, or UPDATE.

Any thoughts?

Deedub84
LVL 1
deedub84Asked:
Who is Participating?
 
seameadowConnect With a Mentor Commented:
Execute it through an ADO connection
        Dim objConn
      Set objConn = New ADODB.Connection
      objConn.Open ("Your Connection String")
      objConn.Execute "Exec dbo._Test_MissingProjectIDs"
0
 
ajitha75Commented:
Try removing the "exec" keyword and running it again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.