LINKING TABLES THROUGH VBA AND ADO

Section 4 of ap_AppInit is the same in both versions:

'-- Section 4: If the Data MDB is found in the App Directory,
         '--            link the files.

          If Dir(pstrAppPath & "\" & pstrBackEndName) = _
                       pstrBackEndName Then

             ap_LinkTables rstSharedTables, pstrAppPath & "\" & _
                            pstrBackEndName
             pstrBackEndPath = pstrAppPath & "\"

          Else

             '-- Section 5: Allow the user to locate the BackEnd MDB
             If Not ap_LocateBackend(rstSharedTables, _
                    strCurrError) Then
                flgLeaveApplication = True
             End If

          End If

You can see how the code checks to see whether there's a copy of the back end in the same directory as the application. If a back end isn't found, the ap_LocateBackend routine is called to help you locate it.

Of the code used in this section ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.