There is an easier way. All stored queries in Access are stored as SQL
strings. The query builder you see only converts it to a GUI so it is easier
to use than writing SQL by hand. When you save a query from the query
builder, it converts it back to the SQL. So all you need to do is read the
SQL string from the Querdef into a string variable and do whatever you want
with it.
strSQL = CurrentBb.QueryDefs("MyQueryName").SQL
> Hi,
> I would like to send queries straight to the Oracle database that I am
[quoted text clipped - 8 lines]
>
> Mark
Mark Olsen - 31 Jan 2006 16:15 GMT
Hi, Thanks. Im using ADO though. Will that work with ADO?
Mark
> There is an easier way. All stored queries in Access are stored as SQL
> strings. The query builder you see only converts it to a GUI so it is easier
[quoted text clipped - 17 lines]
> >
> > Mark
Klatuu - 31 Jan 2006 16:38 GMT
This has nothing to do with DAO or ADO. Queries, regardless of type, are
saved this way. As long as the query you define works with ADO, this
technique will work. It is much easier than trying to maintain and read a
text file.
> Hi, Thanks. Im using ADO though. Will that work with ADO?
>
[quoted text clipped - 21 lines]
> > >
> > > Mark