CDaoQueryDef::GetSQL
Call this member function to retrieve the SQL statement that defines the query on which the querydef is based.
CString GetSQL( );
The SQL statement that defines the query on which the querydef is based.
You will then probably parse the string for keywords, table names, and so on.
For related information, see the topics "SQL Property", "Comparison of Microsoft Jet Database Engine SQL and ANSI SQL", and "Querying a Database with SQL in Code" in DAO Help.
Header: afxdao.h