Linked tables / refreshing links takes long

J

juvi

hello,

I have got an access database splitted into 3 mdbs.

frontend.mdb (has forms and code)
backend.mdb (stores tables with data for work)
archive.mdb (stores tables with data produced)

in the fronted I have linked about 15 tables from backend.mdb (local) and 3
tables from archive.mdb (archive.mdb is on a server in the network)

At startup I am refreshing the links to the actual path of both databases
(backend.mdb and archive.mdb) in my frontend.mdb ..... and this takes a lot
of time: here is my code:

Sub TabloLinkleriniKontrolEt(sSourceFile As String)
Dim daTaban As Database, tbTablo As TableDef
Set daTaban = CurrentDb

For Each tbTablo In daTaban.TableDefs
If InStr(tbTablo.Connect, "DATABASE=") > 0 Then
Debug.Print tbTablo.Connect
If InStr(tbTablo.Connect, NetworkBackENDDB) > 0 Then
If tbTablo.Connect <> ";DATABASE=" & NetworkSyncPathBackEND
& NetworkBackENDDB & ";Pwd=" & UsersDBPWBE Then
tbTablo.Connect = ";DATABASE=" & NetworkSyncPathBackEND
& NetworkBackENDDB & ";Pwd=" & UsersDBPWBE
tbTablo.RefreshLink
End If
End If
If InStr(tbTablo.Connect, backEndDB) > 0 Then
If tbTablo.Connect <> ";DATABASE=" &
Application.CurrentProject.path & "\" & backEndDB & ";Pwd=" & UsersDBPWBE Then
tbTablo.Connect = ";DATABASE=" &
Application.CurrentProject.path & "\" & backEndDB & ";Pwd=" & UsersDBPWBE
tbTablo.RefreshLink
End If
End If
End If
Next
daTaban.Close
End Sub

Hope somebody can help me with this issue.

BR,
juvi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top