[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

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
0
deedub84
Asked:
deedub84
1 Solution
 
ajitha75Commented:
Try removing the "exec" keyword and running it again
0
 
seameadowCommented:
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now