On May 24, 10:31 am, perry...@yahoo.com wrote:
Is this possible? Instead of using the link wizard, can the FE/BE
link be established any other way that users can simply type the link
path?
Thanks,
Perry
Here's a short snippet of code, the actual piece that does it all
spans about 10 different functions and requires a class module:
Set AdCat = CreateObject("ADOX.Catalog")
AdCat.activeconnection = LINK_SRC_ACCESS & "Data Source=" &
CurrentDb.NAme & ";"
If AdCatSrc Is Nothing Then GoTo Done
For Each AdSrc In AdCatSrc.TABLES
If Cancel = True Then Exit For
Link.tableName = AdSrc.NAme
Select Case Link.LinkType
Case LinkType.LNK_ACCESS
If (AdSrc.Properties("Jet OLEDB:Table Hidden In Access").Value
= False Or IncludeHidden = True) And UCase(LEFT(Link.tableName, 4)) <>
"MSYS" And AdSrc.Properties("Jet OLEDB:Create Link") = False Then
Set AdTbl = CreateObject("ADOX.Table")
With AdTbl
.NAme = Link.Prefix & Link.tableName & Link.Suffix
Set .ParentCatalog = AdCat
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Datasource") =
Link.Database
.Properties("Jet OLEDB:Remote Table Name") =
Link.tableName
End With
AdCat.TABLES.Append AdTbl
RaiseEvent TableLinked("ACCESS", Link.Prefix &
Link.tableName & Link.Suffix, Link.tableName)
End If
That should get ya started, or you can just continue to use the
wizard. ;o)