Public Function RelinkTables(new_path As String, old_path As String)
Dim ConnectStr As String, Pos As Integer
Dim rs As DAO.Recordset
Dim tD As DAO.TableDef
Dim openedConn As Boolean
For Each tD In CurrentDb.TableDefs
On Error Resume Next
If (tD.Attributes And dbAttachedTable) = dbAttachedTable Then
' MsgBox tD.Connect
If tD.Connect = old_path Then
Pos = InStr(1, tD.Connect, "DATABASE=")
ConnectStr = Right(tD.Connect, Len(tD.Connect) - Pos - 8)
If LCase(ConnectStr) <> LCase(new_path) Then
DoCmd.Echo False, "Refreshing: " & tD.name
' tD.Connect = ";DATABASE=" & new_path
tD.Connect = new_path
On Error Resume Next
tD.RefreshLink
On Error GoTo 0
On Error Resume Next
'After relinking first table - we open a connection to the database in order to increase the speed of relinking
If Not openedConn Then
Set rs = CurrentDb.OpenRecordset("select * from " & tD.name, adOpenDynamic)
openedConn = True
End If
End If
On Error GoTo 0
End If
End If
On Error GoTo 0
Next
If openedConn Then
rs.Close
Set rs = Nothing
End If
DoCmd.Echo True
End Function
Sub Startup(strPath As String)
On Error GoTo Startup_Err
Dim tdf As DAO.TableDef
Dim strTest As String
For Each tdf In CurrentDb.TableDefs
If Len(Nz(tdf.Connect, "")) > 0 Then
tdf.Connect = (";DATABASE=" & strPath)
tdf.RefreshLink
End If
Next
Startup_Exit:
Exit Sub
Startup_Err:
MsgBox Err.Description
Resume Startup_Exit
End Sub
אל תחמיצו!!!
מנוי פרימיום באתר פרוג, יקפיץ את המוניטין שלך לקהל גדול שאסור לך להחמיץ!
ועכשיו בהזדמנות, מבצע פסח 10% הנחה ברכישת מנוי שנתי!
לוח לימודים
מסלולי לימוד שאפשר לההצטרף
אליהם ממש עכשיו:
2.04
כ"ג אדר ב'
השקה חגיגית
חדש בפרוג
קורס חדשנות AI ובינה מלאכותית
14 שיעורים מפוצצים תוכן על כלי הAI השונים ליצירת תמונות וויז'ואל, עריכת וידאו ומושן, כתיבה ורעיונות, אפיון ועיצוב אתרים ועוד המון!
ההרשמה נפתחה!
20.03
י' אדר ב'
פתיחת מסלול
עיצוב ואדריכלות פנים
מלגות גבוהות!
26.03
טז' אדר ב'
פתיחת מסלול
מאסטר בשיווק דיגיטלי
מלגות גבוהות!
8.05
ל' ניסן
פתיחת מסלול
אוטומציות עסקיות, בוטים והטמעת מערכות מידע
מלגות גבוהות!
9.05
א' אייר
ירושלמי?
יש לנו מלגה מטורפת עבורך! קורס במימון כמעט מלא!!
אוטומציות עסקיות, בוטים והטמעת מערכות מידע
ההרשמה בעיצומה
28.05
כ' אייר
פתיחת מסלול מורחב:
פיתוח ובניית אתרים
מלגות גבוהות!
תהילים פרק קכב
א שִׁיר הַמַּעֲלוֹת לְדָוִד שָׂמַחְתִּי בְּאֹמְרִים לִי בֵּית יְהוָה נֵלֵךְ:ב עֹמְדוֹת הָיוּ רַגְלֵינוּ בִּשְׁעָרַיִךְ יְרוּשָׁלִָם:ג יְרוּשָׁלִַם הַבְּנוּיָה כְּעִיר שֶׁחֻבְּרָה לָּהּ יַחְדָּו:ד שֶׁשָּׁם עָלוּ שְׁבָטִים שִׁבְטֵי יָהּ עֵדוּת לְיִשְׂרָאֵל לְהֹדוֹת לְשֵׁם יְהוָה:ה כִּי שָׁמָּה יָשְׁבוּ כִסְאוֹת לְמִשְׁפָּט כִּסְאוֹת לְבֵית דָּוִיד:ו שַׁאֲלוּ שְׁלוֹם יְרוּשָׁלִָם יִשְׁלָיוּ אֹהֲבָיִךְ:ז יְהִי שָׁלוֹם בְּחֵילֵךְ שַׁלְוָה בְּאַרְמְנוֹתָיִךְ:ח לְמַעַן אַחַי וְרֵעָי אֲדַבְּרָה נָּא שָׁלוֹם בָּךְ:ט לְמַעַן בֵּית יְהוָה אֱלֹהֵינוּ אֲבַקְשָׁה טוֹב לָךְ: