Automatcaly create and/or update Table link from Access

Romanov

Registered User.
Local time
Today, 08:23
Joined
Jan 5, 2002
Messages
10
:confused: I'm aware of how to create a function that automaticaly update my Table links from my Access FrontEnd to tables in a MS-SQL database :

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
 

Users who are viewing this thread

Back
Top Bottom