![ms access pass through query ms access pass through query](https://i.pinimg.com/originals/b0/20/3e/b0203eb3bb59fef4f9cf3898da950cb4.jpg)
‘ Note: Linked Tables can be in more than one back-end. ‘ Purpose: Refresh table links to back-ends in the same folder as front end. So you could use other procedures in unbound forms, such as a Splash form, before calling the RefreshTableLinks procedure.
#MS ACCESS PASS THROUGH QUERY CODE#
To be more precise, the code must be run before a bound form loads data from the tables. It will not relink ODBC, Excel, Outlook, dBASE, Paradox or any other type of linked table or object.ġ) The front-end and back-end tables must be in the same folder.įulfilling this requirement allows the files to be moved to any folder, or a different computer, and the code will automatically relink the tables.Ģ) The code that calls the RefreshTableLinks procedure must be added to the Form Open Event of the first form to be loaded or called by an AutoExec macro.It will not relink tables that are in back-ends that have been renamed.It will not refresh the links of tables that have been renamed or moved to other back-ends.It will not relink Access database tables unless they have already been linked.There are a few things the code will not do: Unlike some methods, will not lose your linked table or TableDef if there is an error.Does not require you enter or store database or table names.Relink tables in multiple back-end Access databases.Relink tables when the databases are moved to a different folder or a different computer.Relink all linked Access database tables if the back-end and front-end are in the same folder.The code loops through the TableDefs Collection and uses the TableDef RefreshLink Method to Refresh the links. The code then uses this information along with the existing path of the front-end database to get the string needed to set the TableDef Connect Property. This includes the names of your linked tables and the names of your back-end databases. The code gets important information from the TableDefs collection in your front-end. Additionally, you do not have to enter the names of your back end database(s) or your linked tables.
![ms access pass through query ms access pass through query](https://image.slidesharecdn.com/sqlpassthrough-13149656108365-phpapp02-110902071837-phpapp02/95/sql-pass-through-and-the-odbc-interface-4-728.jpg)
You do not have to be physically present, nor do you need to remotely access another computer. It can save you a lot of headaches, trouble, travel, and time. This is especially true if you are distributing your database to others. And best of all, you don’t have to know much about writing code to make this work.Īutomating the relinking of tables just makes good sense. The procedure will also relink the tables in multiple back-ends. For more information, contact this article we will show you how you can call a single procedure using just a little code to automatically relink your back-end tables, even when the database files have been moved to a different folder. He also founded Microsoft Access and SQL Azure Information Cente r for developers.
#MS ACCESS PASS THROUGH QUERY SOFTWARE#
( Guest blogger Patrick Wood, an Access MVP, is the founder of Gaining Access Technologies, a software company specializing in working with SQL Azure and Access.