Toad World® Forums

SQL View of MS Access Queries

I connected to a MS Access 2002-2003 format through TOAD for Data Analysts. However, I cannot view all the existing queries from the Access DB as SQL statement in SQL Editor.

Currently, I have to cut and paste the SQL from Access into TOAD SQL Editor and perform “SAVE AS”. This process is too tedious especially when there are 60+ queries.

I am looking for a smart way to accomplish this vs. poor man approach (cut & paste).

Thank you.

Hi Axel,

I agree that this would be a good feature which we do not currently have. I’ve created a new enhancement request, #103652 for tracking.

Thanks,
Mike

Hi Axel,

I’m not sure of your comfort level in VBA, but a good way to do this would be to loop through all your Query objects within Access and export the query definition to it’s own .txt file.

Dim fs As Object ''FileSystemObject
Dim tsOut As Object ''TextStream
sFileOut = “z:\docs\FileOut.txt”
Set fs = CreateObject(“Scripting.FileSystemObject”)
sSQL = CurrentDB.QueryDefs(YOURQUERYNAME).SQL

Set tsOut = fs.CreateTextFile(sFileOut, True)
tsOut.WriteLine sSQL
tsOut.Close

That is rather clever

Debbie