If you want to get a better picture of the SQL statements that Microsoft Jet sends to the remote database server through ODBC, you can trace the SQL operations. To enable SQL tracing, create a TraceSQLMode setting in the \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\3.5\Engines\ODBC key in the Windows Registry and set the value to 1. When you close and restart Microsoft Jet, the engine will log all ODBC calls in the text file Sqlout.txt, which is created in the current directory on your hard disk.
See Also For complete information on Microsoft Jet Registry settings, see Appendix C, “Registry Settings.”
Microsoft Jet always appends new SQL statements to the file while TraceSQLMode is enabled. If you want to disable SQL logging, set the value of TraceSQLMode to 0 and restart Microsoft Jet.
The following table lists the SQL output strings that can appear in the Sqlout.txt file.
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. |
If you are trying to track specific query behavior or diagnose a problem, you may want to archive or delete the Sqlout.txt file before running the query. After you run the query, scan the file for the first instance of SQLPrepare or SQLExecDirect, which should correspond to your first query.