I have followed all suggestions as to removing linked files from an Access database but when I select the table and attempt to delete it using any of the normal deleting methods I gt a MS message window saying that " " is not a valid name. Make sure it does not include invalid characters or punctuation and that it is not too long." (The second quotation mark at the beginning of the message is part of the message.) The table name is valid, only Arabic characters, no punctuation. Every linked table presents the same message when I try to delete it. Any ideas?
Deleting linked tables
Collapse
X
-
Open a standard module in VBA-Editor.
Copy and paste the following code:
Results should be self explanitory.Code:Sub listlinkedtables() ' Dim zdb As DAO.Database Dim ztdf As DAO.TableDef Dim zloop As Long Dim zlinkcnt As Long Dim zerrcnt As Long ' Set zdb = CurrentDb ' On Error GoTo ZJ_Errtrap ' ' ***Start of Code *** '>>> Debug.Print String(20, "=") ' For Each ztdf In zdb.TableDefs zloop = zloop + 1 If ztdf.Attributes = dbAttachedTable Then zlinkcnt = zlinkcnt + 1 Debug.Print "Linked table>> " & ztdf.SourceTableName If Err.Number > 0 Then Err.Clear End If Next ' Debug.Print "Inspected: " & zloop; " tables and found " & zlinkcnt & " linked and with: " & zerrcnt & " errors" Debug.Print String(20, "=") ' Set zdb = Nothing If Not zdb Is Nothing Then Set zdb = Nothing MsgBox "press <CTRL><G> to open the immediate window for information reveiw" ' *** End of Code *** '>>> ' Exit Sub ' 'Connection error ZJ_Errtrap: DoCmd.Hourglass False Debug.Print "ErrorOccured>" & Err.Number & "--" & Err.Description zerrcnt = zerrcnt + 1 Resume Next End Sub
IF and ONLY IF there are errors in the listing, then copy and paste the entire listing in the immediate window to the thread.
Busy day in the lab... on my way home to relax... OK, really, to help the DD with her math. -
Have you done a compact and repair?
Can you rename these table links? (just curious)
Can you get a clean compile? (again just curious,but it's not idle curiosity)
What do you see for the link information if you hover over the link? It might be informative.
You could create a new, blank database and import all the local tables, queries, forms, macros and modules. That's a workaround, it should solve the problem, but won't demonstrate what the real problem is.
JimComment
Comment