|
-
Apr 15th, 2004, 10:49 AM
#1
Thread Starter
Addicted Member
Linked Table Usage
I currently house my data in an MS Acess db. Way back when, I brought in some tables (linked) from another db. Now we are looking at eliminating the other db and I need to find out how I am using those 5 tables I linked so long ago.
Is there a way I can tell which queries are using these tables without having to go into each one (I currently have 167 queries in my db)?
-
Apr 15th, 2004, 12:22 PM
#2
Lively Member
I usually output all queries defenition in some text file, then just search this file for a table name
Below is a very dirty way to output query defenition.
Dim db As Database
Dim qr As QueryDef
Dim i As Integer
Dim strOut As String
Dim fso As Object 'As New Scripting.FileSystemObject
Dim objFile As Object 'As Scripting.TextStream
Dim strSQl As String
Set fso = CreateObject("Scripting.FileSystemObject")
i = 1
Set db = CurrentDb
For Each qr In db.QueryDefs
strSQl = qr.SQL
'If InStr(strSQL, "Delete") = 0 Then
strOut = strOut & i & ". " & qr.Name & vbNewLine & strSQl
strOut = strOut & "*****************************************************" & vbNewLine
'End If
i = i + 1
Next
Set objFile = fso.CreateTextFile("d:\temp\temp_Queries.txt")
objFile.Write strOut
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|