• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 27. STARTUP CHECKING SYSTEM ROUT... > TESTING THE CONNECTIONS OF LINKED TA...

TESTING THE CONNECTIONS OF LINKED TABLES AT STARTUP

As you continue to examine the sections of the ap_AppInit() function, now look at Section 3, which opens and tests the connection for a table located in the back end, with the connection being a link in the front end (see Listing 27.3.)

Listing 27.3. VideoApp(ADO).mdb: Testing the Links

'-- Section 3: Open the table containing the list of
'   linked tables and test the link.
    ' Open employee table.
rstSharedTables.Open "tblSharedTables", cnnLocal, adOpenStatic

On Error Resume Next

rstSharedTables.MoveLast

Dim rstTestTable As New ADODB.Recordset
Dim strTableName As String

strTableName = rstSharedTables!TableName
rstTestTable.Open strTableName, cnnLocal, adOpenStatic

lngCurrError = Err.Number

If lngCurrError = 0 Then

    Dim varTest As Variant
    varTest = rstTestTable(0).Name
    lngCurrError = Err.Number

End If
strCurrError = Err.Description

Do Until lngCurrError = 0

    On Error GoTo Error_ap_App_Init

    Select Case lngCurrError

      Case apErrInvalidSQL


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint