To create a log file of all the SQL queries sent to ODBC for processing,
follow these steps:
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may
require you to reinstall your operating system. Microsoft cannot guarantee that you can solve
problems that result from using Registry Editor incorrectly. Use Registry Editor at your own
risk.
Set the
TraceSQLMode parameter to 1 in the registry. Make this entry to the following registry path:
HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\ODBC
Before you can set the
TraceSQLMode, you may need to create the ODBC
Key and the
TraceSQLMode DWORD value. The Sqlout.txt file generated
is placed in your current directory. You can identify your current
directory by evaluating
?CurDir() in the Immediate window.
The setting is:
To turn off the
TraceSQLMode option, change the setting from 1 to 0.
NOTE: After setting this option, you must restart Microsoft Access for the change to take effect. SQL statements sent to an ODBC data source
continue to be recorded in the Sqlout.txt file as long as the
TraceSQLMode setting is set to 1.
A sample of the SQL statement from the SQL view in a Microsoft
Access query follows:
SELECT DISTINCTROW dbo_authors.au_id, dbo_authors.au_lname,
dbo_authors.au_fname, dbo_authors.phone, dbo_authors.address,
dbo_authors.city, dbo_authors.state, dbo_authors.zip,
dbo_authors.contract FROM dbo_authors;
A sample Sqlout.txt file may appear as follows:
SQLExecDirect: SELECT Config, nValue FROM MSysConf
SQLExecDirect: SELECT "dbo"."authors"."au_id" FROM "dbo"."authors"
The following table outlines log entries that may appear in the Sqlout.txt file:
Collapse this tableExpand this table
Log entry | Description |
---|
SQLExecDirect: SQL-string | The calling application executed a non-parameter user query |
SQLPrepare: SQL-string | The calling application prepared a parameter user query. |
SQLExecute: (PARAMETERIZED QUERY) | The calling application executed a prepared, parameter user query. |
SQLExecute: (GOTO BOOKMARK) | The calling application retrieved a single record based on a bookmark. |
SQLExecute: (MULTI-RECORD FETCH) | The calling application retrieved multiple records based on multiple bookmarks. |
SQLExecute: (MEMO FETCH) | The calling application retrieved a Memo field for a single record based on a bookmark. |
SQLExecute: (GRAPHIC FETCH) | The calling application retrieved a Long Binary (OLE Object) field for a single record based on a bookmark. |
SQLExecute: (RECORD-FIXUP SEEK) | The calling application retrieved a single record based on an index key (not necessarily the bookmark index). |
SQLExecute: (UPDATE) | The calling application updated a single record based on a bookmark. |
SQLExecute: (DELETE) | The calling application deleted a single record based on a bookmark. |
SQLExecute: (INSERT) | The calling application inserted a single record in dynaset mode. |
SQLExecute: (SELECT INTO insert) | The calling application inserted a single record in export mode. |