Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Export Queries as SQL

Author  Topic 

NeilC
Yak Posting Veteran

55 Posts

Posted - 2006-12-06 : 09:34:42
How can I export the SQL of my queries? When I right click a query and select 'Design View', then right click the top frame and choose 'SQL View'

I have quite a lot of queries that I need as SQL and it would take quite a lot of time to copy and paste and save them as SQL manually.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-06 : 09:52:50
You can do this in VBA by iterating the collection for queries.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

NeilC
Yak Posting Veteran

55 Posts

Posted - 2006-12-06 : 10:08:21
Can you expand on this?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-06 : 10:10:53
In the DAO object there is a collection for queries and tables. Iterate through them and use the .Code property (can be named something else) to write to file.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -