Created
November 10, 2021 19:28
-
-
Save bryaneaton/33a9d8eda62fefe94627c44f36a5d029 to your computer and use it in GitHub Desktop.
Dump Access Queries to Text file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Sub ListQueries() | |
' Modified from André Bernardes | |
Dim i As Integer | |
Dim ff As Long | |
ff = FreeFile() | |
Open "C:\temp\Queries.txt" For Output As #ff | |
On Error Resume Next | |
For i = 0 To CurrentDb.QueryDefs.Count - 1 | |
Debug.Print "|" & CurrentDb.QueryDefs(i).Name & ":" | |
Print #ff, "|" & CurrentDb.QueryDefs(i).Name & ":" | |
Debug.Print CurrentDb.QueryDefs(i).SQL | |
Print #ff, CurrentDb.QueryDefs(i).SQL | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment