Because your asking for any database engine, I believe the only reliable approach is to instrument your application to log the SQL prior to executing it. There are several ways to do this, from creating descendant objects from the existing TAdoxxxx ones, to creating simple functions that you must remember to call each time you want something inspected. As far as logging, one of the prefered methods is to use outputdebugstring to send it to the debug console. When delphi is running, this will show up in the messages window. There is a standalone executable DebugView which can be used on remote systems.
If your just wanting access to the SQL while debugging (so you can test and tune external to your application) and your using a tAdoQuery component, you can use the debug evaluator to save this to a file. Just set a break point right before the open, then at the breakpoint run the debug evaluator and enter the name of your query component followed by: .sql.savetofile('c:\sqlfilename.sql')
and then press return, it will save the entirety of your existing SQL to the file specified. This can be a lifesaver if your SQL is being generated or is too large to view using the debug inspector.