Jasinski Technical Wiki


Home Page
All Pages

Quick Search
Advanced Search »

Contributor Links

Create a new Page
File Management
Your Profile

Other Wiki Sections



Page History: Searching All Database Objects - Microsoft Access

Compare Page Revisions

« Older Revision - Back to Page History - Newer Revision »

Page Revision: Fri, Oct 05, 2012, 8:43 AM

Public Sub ExamineAllQueries()

    Const lookFor As String = "product"

    Dim imin As Long
    Dim imax As Long
    Dim i As Long
    Dim sSql As String
    Dim lookForUpper As String

    With DBEngine.Workspaces(0).Databases(0)
        imin = 0
        imax = .QueryDefs.Count - 1 + imin
        lookForUpper = UCase$(lookFor)
        Debug.Print "====================================================================="
        Debug.Print "  The SQL for the following queries contain '" & lookFor & "'"
        Debug.Print "---------------------------------------------------------------------"
        For i = imin To imax
            sSql = UCase$(.QueryDefs(i).SQL)
            If sSql Like "*" & lookForUpper & "*" Then
                Debug.Print .QueryDefs(i).name
            End If
    End With

End Sub

ScrewTurn Wiki version Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2020, Patrick Jasinski.