Using the answer provided from SQL Server Passthrough query as basis for a DAO recordset in Access as a starting poing, I have the following VBA code. The pass-through query contains all the connection information and I’ve confirmed the SQL syntax is correct by running it multiple times, so not sure what I’m missing in my VBA call. How can I get this query to run from VBA? I’d like it to run when my “splash screen” loads. How can I get This query to run from VBA? This removes the overhead of the Microsoft Jet database engine. When you run the query, it sends commands directly to the database server for processing. For the connection string I am using the ODBC connection string from the Property tab.Īn SQL pass-through query is made up of an SQL statement and a connection string. However, this prompts an error Type mismatch on the Debug.Print rst.
How to Access VBA pass through query in SQL? Select Relink again until you have fixed each failed linked table and the Status column displays “Success”.
Create a new Scheduled Task to launch the shortcut file.ĭoes Access automatically update linked tables?Īccess automatically refreshes the status to indicate success or failure.This creates an “executable” shortcut that opens the database and runs the macro.
How do I create a SQL pass-through query in Access 2016?