
Export "Query Text" using VBA
Anyone know how to export the actual query text (not the
recordset result) programatically of many queries
developed in Access (which now must be ported to DTS
because of Access ineptitude)? I tried "AllQueries" but
it seems to just give me the names of the queries, total
count, etc. but not the 'select ...' part.
Thanks!
ps. This code will put the values into a string:
Dim myQueries As String
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllQueries
myRows = myQueries & obj.Name & vbCrLf
Next obj
What I want is something like this:
Dim myQueries As String
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllQueries
myRows = myQueries & obj.Name & " / " &
obj.QueryText & vbCrLf
Next obj
but there is no obj.QueryText that I know of...