ADT/ODE: How to Modify RefreshTableLinks Module in Solutions.mdbLast reviewed: October 20, 1997Article ID: Q154397 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. The RefreshTableLinks module in the Developer Solutions sample application (Solutions.mdb) demonstrates a method of updating the connection information for linked (attached) tables in an application that uses multiple databases. This article describes how you can modify the functions used in the modRefreshTableLinks module (or RefreshTableLinks module in Solutions.mdb for Microsoft Access 7.0) to work in a run-time environment. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.
MORE INFORMATIONTo modify the functions used in the modRefreshTableLinks module to work in a run-time environment, follow these steps while running the retail version of Microsoft Access. Each of these steps is described in detail in the following sections.
Step 1Import the modRefreshTableLinks Module from Solutions.mdb:
Step 2Follow these steps to modify the CheckLinks() function to test if the path of your current attachments are correct:
Step 3Follow these steps to modify the FindNorthwind() function to display the Open File dialog box for the user to locate your back-end database. The function returns the full path to the back-end database:
Step 4Follow these steps to modify the RelinkTables() function to look for a table in your linked database and replace references to Northwind.mdb and Solutions.mdb with references to your application:
Step 5Call the ReLinkTables() Function in your application's AutoExec Macro or from your SwitchBoard's Load event. In the Developer Solutions sample application, the ReLinkTables() function is called from the DeveloperSolutions (or Solutions in Microsoft Access 7.0) form's Load event. This function determines whether the table attachments are valid. If the attachments are not valid, the function prompts the user for the location of the linked tables. The ReLinkTables() function could also be called from your AutoExec macro. The AutoExec macro entries are as follows:
Condition Action ------------------------------------------------------------------------ NOT ReLinkTables() RunCommand (or DoMenuItem in Microsoft Access 7.0) OpenForm Action Arguments --------------------------------------------- RunCommand or DoMenuItem Command: Close Menu Bar: Database Menu Name: File Command: Close OpenForm Form Name: <your SwitchBoard's name> |
Additional query words: attach adt
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |