O'Reilly logo

F. Scott Barker's Microsoft® Access 2000 Power Programming by F. Scott Barker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required