in reply to Getting SQL Statement From Saved Query in Microsoft Access Database

Here's some VB code to modify a stored query:

Modifing a Stored Query with VBA

Have a look at the ModifyQuery subroutine. It appears you can access the query's SQL using cmd.CommandText. That routine sets the CommandText property, but it seems reasonable that you should also be able to read it.

This node: Re: Create a MS Access database programmatically in perl shows how to create the requisite ADOX.Catalog object in perl using Win32::OLE.

Disclaimer: I'm not a VB or ADOX expert - I'm not even sure I know what I'm talking about :-)

Replies are listed 'Best First'.
Re^2: Getting SQL Statement From Saved Query in Microsoft Access Database
by Jim (Curate) on Jun 02, 2008 at 14:04 UTC
    pc88mxer++!

    The property named "CommandText" is just what I needed to search the Web for ready-made solutions that will save me hours of reading ponderous and Byzantine Microsoft documentation on MSDN. Thanks for the helpful links!

    Jim