Relink all tables
Posted by: fredometro on
Jan 1st, 2004 |
Filed under: MS-Access
This function relinks the tables to the database designed by its path.
Option Compare Database
Option Explicit
Public Sub RelinkTables(ThePath)
Dim dbf As Database
Dim tdf As TableDef
Dim count, totcount
DoCmd.Hourglass True
Set dbf = CurrentDb()
totcount = dbf.TableDefs.count
If IsNull(ThePath) Then
DoCmd.Hourglass False
MsgBox “please choose a database source.”, vbCritical
Exit Sub
End If
For Each tdf In dbf.TableDefs
’Debug.Print NoPath(tdf.Connect), tdf.Connect
If tdf.Connect <> “” Then
tdf.Connect = “;DATABASE=” & ThePath & NoPath(tdf.Connect)
On Error Resume Next
tdf.RefreshLink
If Err <> 0 And Err <> 3024 And Err <> 3219 And Err <> 3151 and Err <> 3022 Then
DoCmd.Hourglass False
MsgBox Error$, vbCritical
Exit Sub
End If
On Error GoTo 0
End If
count = count + 1
Forms![Relink]![Progress] = count & “/” & totcount & ” linked”
DoEvents
Next tdf
DoCmd.Hourglass False
MsgBox “Successfully linked to specified data source.”, vbInformation
End Sub
Public Function NoPath(TheText)
Dim i, ch, result
i = Len(TheText)
While ch <> “\” And i > 0
ch = Mid(TheText, i, 1)
If ch <> “\” Then result = ch & result
i = i - 1
Wend
NoPath = result
End Function


December 12th, 2009 at 2:55 am
Amateur Gang
December 12th, 2009 at 2:56 am
Naughty Staff
December 12th, 2009 at 2:57 am
Ghetto Gaggers
December 12th, 2009 at 2:58 am
Latex Slut Show
December 12th, 2009 at 2:59 am
Gang Banged Babes
December 12th, 2009 at 3:00 am
Carmen Luvana
December 12th, 2009 at 3:01 am
Kamilla 18
December 12th, 2009 at 3:02 am
Free MILF
December 12th, 2009 at 3:03 am
18 Pussy Club
December 12th, 2009 at 3:04 am
Stephanie Sage
December 12th, 2009 at 3:05 am
Big Breasts Sex
December 12th, 2009 at 3:08 am
Sweet Krissy
December 12th, 2009 at 3:09 am
Bad Black Babes
December 12th, 2009 at 3:10 am
Awesome Hardcore
April 6th, 2010 at 10:44 am
……
????????? ?? ??? ????????…
Add A Comment
You must be logged in to post a comment.