Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re-linking remote tables within a query
Message
From
22/10/2001 20:20:20
 
General information
Forum:
Microsoft Office
Category:
Access
Miscellaneous
Thread ID:
00571906
Message ID:
00571916
Views:
23
This message has been marked as the solution to the initial question of the thread.
>I'm a VFP person, so this is a bit foreign to me:
>
>I have a whole list of edit queries in Access that were built on local tables. The tables have since been moved to an external db file to aid in distribution, but the queries now give "table not found" errors when run.
>
>The linked tables have identical names as the local tables had....this worked well when running SQL statements, but the Queries must be somehow hard-coded for location.
>
>
>any ideas?

How did you moved the files? The easy way to do this is by using the split database wizard, it takes care of keeping the correct links. In any case, see if you can use this code snippet for programatically linking to external tables. (even though the sample shows foxpro 2.x style tables):
   Set thisdb = CurrentDb
   
   For i = 0 To thisdb.TableDefs.Count - 1
      strConn = thisdb.TableDefs(i).Connect
      If Len(strConn) > 0 And InStr(1, strConn, "FoxPro", 1) <> 0 Then
         thisdb.TableDefs(i).Connect = "FoxPro 2.6;DATABASE=" & strNewConn
         thisdb.TableDefs(i).RefreshLink
      End If
   Next i
   
   thisdb.TableDefs.Refresh
You can modify this to fit your needs, either to display or refresh the correct links. HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform