A family of Microsoft relational database management systems designed for ease of use.
Please don't piggyback your question on another thread. You should start a new question using the Participate link.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
SOLUTION TO ERROR " Your network access was interrupted. To continue close the database and then open it again."
A family of Microsoft relational database management systems designed for ease of use.
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.
Please don't piggyback your question on another thread. You should start a new question using the Participate link.
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.
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
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
Sorry you are upset. Shouting is not going to get this fixed.
Let's try to be rational about it. You claim it's an Access problem; others (and I count myself among them) claim it's a network problem. You don't believe that.
Can we agree on a test? As long as your network is in play the disagreement may continue and you're getting nowhere, so let's take that out of the equation: if you can reproduce the error while all the files are on the local machine, you will have a stronger case to make. Or if you can setup a test at a friend or two's networks and the error continues to appear, you will again have a stronger case to make.
Another way to side-step the issue is to upsize your back-end database to the free Express edition of SQL Server. It "never" corrupts and is not sensitive to network discontinuities.
We have the same error, and only on Win 7 pcs with Office 2010 , all Win XP pcs with Office 2003 in the same location never have the issue. I have tested the network running a constant test and it never drops, but still get the same error as everyone else. So I think its pretty safe to say its not a network fault its something else.