> How can I use Visual Basic to view the SQL built into a
> I have two databases in SQL Server.
> One is on a SQL 7 production server,
> and the other is on a SQL 2000 test server.
> Both databases have tables and queries,
> stored in SQL Server. The tables and queries
> should be the same in both databases.
> I have a regression test suite in Visual Basic 6,
> which verifies that if I put certain sample data
> into the test database, the queries return
> certain results. It also verifies that
> the table names, query names, column names,
> and data types match. (This is just a matter of
> opening an empty recordset against corresponding
> tables or queries, and comparing the fields.)
> How can I write a regression test in Visual Basic
> to verify the query SQL? For example, if both
> databases have a qry_ExtremeValue query,
> how can I make sure that they both query
> "SELECT TOP 1 * FROM tbl_base ORDER BY id ASC",
> "SELECT TOP 1 * FROM tbl_base ORDER BY id DESC"?
> (It does not do me much good to make sure the
> test database works fine, if the test database
> does not have the same structure as the
> production database.)