Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Linked table manager

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SHIPP - 31 Jan 2006 14:39 GMT
I am trying to relink my tables. I'm getting the message "Invalid Procedure
Call or Argument." All I can say is OK. I can't get to the link menu. Any
ideas folks? I'm using Access 97. Otherwise the database works just fine.
Signature

M. Shipp

Scott Burke - 31 Jan 2006 19:01 GMT
I use this funciton.  I have only used it in XP Pro.  
It only changes the link.  It will NOT add or subtract links.

Function linkmetest()
   Rem JetTable = Access table
   Call linkme("C:\CLEARWIN\BACKEND.MDB", "AGENCIES")
   Call linkme("C:\CLEARWIN\BACKEND.MDB", "CEASEDPUBS")
   Call linkme("C:\CLEARWIN\BACKEND.MDB", "CLEAR_DATE_LIST")
   Call linkme("C:\CLEARWIN\COA_CANCELBACKEND.MDB", "COA_CANCEL")
   Call linkme("C:\CLEARWIN\COA_CANCELBACKEND.MDB", "CPPASSWORD")
   Call linkme("C:\CLEARWIN\TRANSFERBACKEND.MDB", "DONE")
   Call linkme("C:\CLEARWIN\HISTORY.MDB", "HISTORY")
   Call linkme("C:\CLEARWIN\BACKEND.MDB", "MAGINFO")
   Call linkme("C:\CLEARWIN\HISTORY.MDB", "ORDSUM")
   Call linkme("C:\CLEARWIN\COA_CANCELBACKEND.MDB", "PASSWORD")
   
End Function

Function linkmelive()
   Rem link table to live database.
   Call linkme("T:\CLEARWIN\BACKEND.MDB", "AGENCIES")
   Call linkme("T:\CLEARWIN\BACKEND.MDB", "CEASEDPUBS")
   Call linkme("T:\CLEARWIN\BACKEND.MDB", "CLEAR_DATE_LIST")
   Call linkme("T:\CLEARWIN\COA_CANCELBACKEND.MDB", "COA_CANCEL")
   Call linkme("T:\CLEARWIN\COA_CANCELBACKEND.MDB", "CPPASSWORD")
   Call linkme("T:\CLEARWIN\TRANSFERBACKEND.MDB", "DONE")
   Call linkme("T:\ACCESSFILES\HISTORY.MDB", "HISTORY")
   Call linkme("T:\CLEARWIN\BACKEND.MDB", "MAGINFO")
   Call linkme("T:\ACCESSFILES\HISTORY.MDB", "ORDSUM")
   Call linkme("T:\CLEARWIN\COA_CANCELBACKEND.MDB", "PASSWORD")
   
End Function

Function linkme(strDatabase As String, strNewTable As String)
  Dim dbs As Database
  Dim tdf As TableDef
     
  Set dbs = CurrentDb()
 
  For Each tdf In dbs.TableDefs
      Rem use only the linked tables
      If Len(tdf.Connect) > 0 Then
         Rem this is a linked table
       
         Rem if this is the name of the table.
         Rem then change the database location.
         If tdf.NAME = strNewTable Then
            tdf.Connect = ";database=" & strDatabase
            tdf.RefreshLink
         End If
     
      Else
        Rem not a connected table
      End If
  Next tdf

  Rem cleanup
  Set tdf = Nothing
  Set dbs = Nothing

End Function

Scott Burke
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.