Jest coś, czego często używam, aby dowiedzieć się, gdzie niektóre funkcje lub zapytania mogą ukryć się w nieoczekiwanym miejscu (np. W źródle wiersza kontrolowanej w ramach pod-zapytania).
Używam nieudokumentowanej funkcji do eksportowania wszystkich obiektów programu Access jako nieprzetworzonych plików tekstowych.
Korzystając z edytora tekstów, który może wyszukiwać w plikach rekurencyjnie w folderze (na przykład wolnym od Notepad++), jestem pewny, że znajdę wszystkie wystąpienia, nawet zakopane, określonego ciągu.
Kodeks wywozu wszystkich przedmiotów zawiera moje IsBlank() function:
'====================================================================
' Name: DocDatabase
' Purpose: Documents the database to a series of text files
' From: http://www.datastrat.com/Code/DocDatabase.txt
' Author: Arvin Meyer
' Date: June 02, 1999
' Comment: Uses the undocumented [Application.SaveAsText] syntax
' To reload use the syntax [Application.LoadFromText]
' Modified to set a reference to DAO 8/22/2005
' Modified by Renaud Bompuis to export Queries as proper SQL
'====================================================================
Public Sub DocDatabase(Optional path As Variant = Null)
If IsBlank(path) Then
path = Application.CurrentProject.path & "\" & Application.CurrentProject.Name & " - exploded view\"
End If
On Error Resume Next
MkDir path
MkDir path & "\Forms\"
MkDir path & "\Queries\"
MkDir path & "\Queries(SQL)\"
MkDir path & "\Reports\"
MkDir path & "\Modules\"
MkDir path & "\Scripts\"
On Error GoTo Err_DocDatabase
Dim dbs As DAO.Database
Dim cnt As DAO.Container
Dim doc As DAO.Document
Dim i As Integer
Set dbs = CurrentDb() ' use CurrentDb() to refresh Collections
Set cnt = dbs.Containers("Forms")
For Each doc In cnt.Documents
Application.SaveAsText acForm, doc.Name, path & "\Forms\" & doc.Name & ".txt"
Next doc
Set cnt = dbs.Containers("Reports")
For Each doc In cnt.Documents
Application.SaveAsText acReport, doc.Name, path & "\Reports\" & doc.Name & ".txt"
Next doc
Set cnt = dbs.Containers("Scripts")
For Each doc In cnt.Documents
Application.SaveAsText acMacro, doc.Name, path & "\Scripts\" & doc.Name & ".txt"
Next doc
Set cnt = dbs.Containers("Modules")
For Each doc In cnt.Documents
Application.SaveAsText acModule, doc.Name, path & "\Modules\" & doc.Name & ".txt"
Next doc
Dim intfile As Long
Dim filename as String
For i = 0 To dbs.QueryDefs.count - 1
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, path & "\Queries\" & dbs.QueryDefs(i).Name & ".txt"
filename = path & "\Queries(SQL)\" & dbs.QueryDefs(i).Name & ".txt"
intfile = FreeFile()
Open filename For Output As #intfile
Print #intfile, dbs.QueryDefs(i).sql
Close #intfile
Next i
Set doc = Nothing
Set cnt = Nothing
Set dbs = Nothing
Exit_DocDatabase:
Debug.Print "Done."
Exit Sub
Err_DocDatabase:
Select Case Err
Case Else
MsgBox Err.Description
Resume Exit_DocDatabase
End Select
End Sub
Aby z niego skorzystać, wystarczy zadzwonić DocDatabase
od oknie Immediate w dostępie IDE, stworzy zestaw katalogów pod i „widok rozebranego” folder, który będzie zawierał wszystkie pliki.
super !! Dziękuję Ci. – waanders
+1 Dodałem link do IsBlank() funtion. Ładny blog. To mi się przyda. – HansUp
Myślę, że wolałbym "Opcjonalną ścieżkę jako ciąg =" "", ale to chyba tylko ja unikam wariantu, gdzie tylko mogę. – HansUp