SOLUTION TO ERROR " Your network access was interrupted. To continue close the database and then open it again." __

Anonymous
2010-11-02T01:50:09+00:00

SOLUTION TO ERROR " Your network access was interrupted. To continue close the database and then open it again."

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

91 answers

Sort by: Most helpful
  1. Anonymous
    2014-06-04T14:25:07+00:00

    Ahh bite me. 

    I experienced the error described in the previous question, and asked the question including my circumstances. luckily I have resolved it, and have posted full information for anyone that follows.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,840 Reputation points Volunteer Moderator
    2014-06-04T14:20:11+00:00

    Please don't piggyback your question on another thread. You should start a new question using the Participate link.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-06-04T14:14:57+00:00

    So, halfway to resolving...

    The error occurred in the function TablesMatch, which is...

    Private Function TablesMatch(strFileName As String) As String

        On Error GoTo ErrorHere

        Dim intFlag As Integer, dbLocal As Database, dbBackEnd As Database

        Dim tdLocal As TableDef, tdBackEnd As TableDef, strReturn As String

        Dim strLocalTableStriped As String

        intFlag = False   ' Initial value, process by exception.

        Set dbLocal = CurrentDb

        Set dbBackEnd = DBEngine(0).OpenDatabase(strFileName)

        Set dbLocal = CurrentDb

        For Each tdLocal In dbLocal.TableDefs   ' Loop through local tables.

            If Len(tdLocal.Connect) > 0 Then    ' This is an attached table.

                For Each tdBackEnd In dbBackEnd.TableDefs    ' Loop thru back-end

                    strLocalTableStriped = StripPrefix(tdLocal.SourceTableName)

                    strReturn = strLocalTableStriped

                    'Debug.Print strLocalTableStriped & " <> " & tdBackEnd.Name

                    If strLocalTableStriped = tdBackEnd.Name Then

                        intFlag = True    ' We found a match in back-end.

                        Debug.Print "-- Found it! -- " & tdBackEnd.Name

                        Exit For  ' Jump out for next search.

                    End If

                Next

                If intFlag = False Then    ' No match for this attached table.

                    TablesMatch = strReturn

                    Exit Function

                Else    ' There was a match--continue searching next attachment.

                    intFlag = False    ' Reset flag for next table test.

                End If

            End If

        Next

        ' If the function reached here, all tables matched.

        TablesMatch = "OK"

    ExitHere:

        Exit Function

    ErrorHere:

        Call LogError(Application.CurrentObjectName, "TablesMatch", Err.Number, Err.Description, False)

        Resume ExitHere

    End Function

    The first time this is called from the function RelinkAccess it reports the first table name rather than the status "OK". So clearly a problem. I removed it from the function RelinkAccess (where it checks if all TablesMatch) and ran the contents of the contents of the IF/THEN/ELSE without confirming that TablesMatch. Everything ran, BUT didn't get all tables. (for my reference it crapped out on T09 WHICH WAS A TABLE THAT HAD BEEN DELETED FROM THE BE, BUT STILL APPEARED IN THE FE). Ran everything a 2nd time AND EVERYHTING WORKED FINE.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-06-04T13:47:55+00:00

    I just copied a database (Front End and Back End) to a new laptop.

    Worked fine on old laptop (Windows 7/64, Office 2007)

    Get this error on new laptop. (Windows 7/64, Office 2010)

    I am NOT connected to a network

    I have both FE and BE in a sub folder of My Documents.

    The FE should connect to the BE using code rather than linked table manager.

    It works fine on the old laptop, and this code works fine in databases I have sold to several customers.

    There is no network. Period.

    This is the code. Please excuse the various message boxes I've tried debugging with...

    Private Sub cmdRelinkTables_Click()

    On Error GoTo ErrorHere

    ' This is the code directly under the button marked OPEN DATABASE that the user clicks to connect the FE to the BE

        If Me.Dirty = True Then

            Me.Dirty = False

        End If

        Me.txtConnectionString.Requery

        If chkBackEndServerAccess <> 0 Then

            If Nz(Me.txtAccessPathAndFilename, "") = "" Then

                MsgBox "A backend database must be selected", vbInformation + vbOKOnly, "Invalid Entry"

                Me.txtAccessPathAndFilename.SetFocus

                GoTo ExitHere

            End If

            Call RelinkAccess

        Else

            Dim strDriver As String

            strDriver = Me.txtDriver

            If IsODBCDriverInstalled(strDriver) = False Then

                MsgBox "Driver : " & strDriver & vbCrLf & "is not installed, please download it and install it and try again", vbInformation + vbOKOnly, "ODBC Driver not installed"

                txtDriver.SetFocus

                GoTo ExitHere

            End If

            Call RelinkODBC

            If (Me.txtDatabase = "TESTDATA") Then

                MsgBox "You have connected to the test database in our data centre" & vbCrLf _

                & " DO NOT enter confidential information into this database"

            End If

        End If

        MsgBox "Code seems to run up to here. IE I see this message." (BUT since found out code is failing in sub RELINKACCESS)

         ' Current User Details: remains open in background. Used to populate other data fields

         DoCmd.OpenForm "frmCurrentUserDetails", , , , , acHidden

        MsgBox "BUT NOT THIS ONE"

        'Dashboard

        DoCmd.OpenForm "MF01_MainMenu"

        ' Hide this form

        Me.Visible = False

    ExitHere:

        Exit Sub

    ErrorHere:

        ' Call LogError(Application.CurrentObjectName, "cmdRelinkTables_Click", Err.Number, Err.Description, False)

        Resume ExitHere

    End Sub

    Private Sub RelinkAccess()

    On Error GoTo ErrorHere

        Dim dbLocal As Database

        Dim tdLocal As TableDef

        Dim strBackEnd As String

        Dim strTablesMatch As String

        Dim strTable As String

        'On Error Resume Next   ' Turn off error check for test.

        strBackEnd = Trim(Me!AccessPathAndFilename)

        On Error GoTo ErrorHere

        MsgBox "1.1"

        MsgBox strBackEnd

        If Not fExistFile(strBackEnd) Then   ' File not found.

            MsgBox "Backend File not found. Please try again.", vbExclamation, _

                   "Link to new Backend"

        Else

            MsgBox "1.3 - BACK END FOUND"

            strTablesMatch = TablesMatch(strBackEnd)

            MsgBox strTablesMatch & " IF not OK Then there is a problem"

            MsgBox TablesMatch(strBackEnd) '***** IT IS NOT "OK" it comes back with name of one of the tables"

            If strTablesMatch = "OK" Then  ' A valid database.

                Set dbLocal = CurrentDb

                DoCmd.Hourglass True

                For Each tdLocal In dbLocal.TableDefs  ' Loop through all tables.

                    If Len(tdLocal.Connect) > 0 Then    ' This is an linked table.

                        strTable = tdLocal.Name

                        DoCmd.Echo True, "Linking table : '" & strTable & "' ..."

                        MsgBox "Linking " & strTable

                        ' Delete

                        DoCmd.DeleteObject acTable, tdLocal.Name

                        ' Link Back

                        DoCmd.TransferDatabase acLink, "Microsoft Access", strBackEnd, acTable, strTable, strTable, , True

                    End If

                Next

                DoCmd.Echo True, "Done"

                DoCmd.Hourglass False

                Set dbLocal = Nothing

            Else   ' Tables didn't match the tablenames in this database.

                MsgBox "The table " & strTablesMatch & " can not be found in Backend" & Me!txtBackEndPath & _

                       " didn't match the current database", vbExclamation + vbOKOnly, "Error in TablesMatch"

            End If

        End If

        MsgBox "1.2"

    ExitHere:

        Exit Sub

    ErrorHere:

        MsgBox "Error in RelinkAccess"

        Call LogError(Application.CurrentObjectName, "RelinkAccess", Err.Number, Err.Description, False)

        Resume ExitHere

    End Sub

    Was this answer helpful?

    0 comments No comments
  5. Tom van Stiphout 40,216 Reputation points MVP Volunteer Moderator
    2014-05-01T14:03:55+00:00

    I'm trying to reproduce the problem using similar code against the Northwind sample application but it's not generating an error. Would you be able to make a test version available, stripped to the bare essentials?

    tom 7744 at cox dot net

    Was this answer helpful?

    0 comments No comments