Advertisement
7_2009-2012 Microsoft Office Apps/VBA #228081

Access Linked Table Path Correction

When the folder of an access application and its linked table source changes, this code will modify the linked tables to comply.

AI

ИИ-обзор: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Исходный код
original-source
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 tbTablo.Connect <> ";DATABASE=" & Application.CurrentProject.Path & "\" & sSourceFile Then
  tbTablo.Connect = ";DATABASE=" & Application.CurrentProject.Path & "\" & sSourceFile
  tbTablo.RefreshLink
  End If
 End If
 Next
 daTaban.Close
End Sub
Оригинальные комментарии (3)
Восстановлено из Wayback Machine