
Public Sub RefreshLinksSQL()
On Error GoTo RefreshLinks_Error
Dim X As Integer, tbds As TableDefs
Set tbds = CurrentDb.TableDefs
For X = 0 To tbds.Count - 1
Select Case tbds(X).Attributes
Case dbAttachExclusive, dbAttachSavePWD, dbAttachedTable, dbAttachedODBC
tbds(X).RefreshLink
End Select
Next X
Exit Sub
RefreshLinks_Error:
MsgBox Err.Number & ":" & Err.Description, vbCritical
End Sub
-----------------------------------
How do I create a link to another MS-SQL database (a subscriber with the same tables). Either by pointing to another database (System DSN) and just let it change the table links to this, or by writing a code with the name of each table I wornt to link.
If this is posible, is there then a way where at the same time can point out what is the key in each table (or view)?
Romanov