Finding a function call in queries

C

cherman

Does anyone know of a way to find if a function is being called from a query?
Another words, I have a function that might be called from 1 or more queries
in my DB and I am looking for a quick way to see which queries it is called
from.

With over 200 queries in my DB, it will take me some time to check them
manually, and I have 2 functions to check.

Is there a utility or something that will do this for me?

Thanks!
 
J

John W. Vinson

Does anyone know of a way to find if a function is being called from a query?
Another words, I have a function that might be called from 1 or more queries
in my DB and I am looking for a quick way to see which queries it is called
from.

With over 200 queries in my DB, it will take me some time to check them
manually, and I have 2 functions to check.

Is there a utility or something that will do this for me?

Thanks!

There are a few third party utilities that will do this:

Free: http://www3.bc.sympatico.ca/starthere/findandreplace
Find and Replace: http://www.rickworld.com
Speed Ferret: http://www.moshannon.com
Total Access Analyzer: http://www.fmsinc.com

Some of these links are rather old and may not be current.

You could also use VBA to loop through the QueryDefs collection and search for
the function name in the SQL property:

Dim qd As DAO.Querydef
For Each qd IN CurrentDb.Querydefs
If InStr("MyFunction", qd.Sql) > 0 Then
Debug.Print qd.Name
End If
End Sub

Untested air code!
 
F

fredg

Does anyone know of a way to find if a function is being called from a query?
Another words, I have a function that might be called from 1 or more queries
in my DB and I am looking for a quick way to see which queries it is called
from.

With over 200 queries in my DB, it will take me some time to check them
manually, and I have 2 functions to check.

Is there a utility or something that will do this for me?

Thanks!

Public Sub FindFunction()
Dim qdf As DAO.QueryDef
For Each qdf In CurrentDb.QueryDefs
If InStr(qdf.SQL, "FunctionName1") > 0 Or InStr(qdf.SQL,
"FunctionName2") > 0Then
Debug.Print qdf.Name & " " & qdf.SQL
End If
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top