Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to monitor and log actual queries made against an Access MDB?

Tags:

Is it possible to monitor what is happening to an Access MDB (ie. what SQL queries are being executed against it), in the same way as you would use SQL Profiler for the SQL Server?

I need logs of actual queries being called.

like image 252
CJ7 Avatar asked Apr 29 '10 07:04

CJ7


People also ask

Can queries be saved in an Access database?

Save Access queries by using the "Save" icon on the Quick Access Toolbar. Access is the database component of the Microsoft Office suite. Databases let you configure large quantities of data into concise queries and reports. The queries used in Access let you ask a question of your database.

How do I view queries in Access?

Answer: To view the queries in the Navigation Pane, click on the Navigation Pane menu and select "Queries" from the popup menu. Now the Navigation Pane should display all of the queries that are in your database.

Can you run queries in Access?

You can run a query in Access when using query design view. To do this, click the “Query Design” contextual tab in the Ribbon. In older versions of Access, this tab is called the “Design” tab of the “Query Tools” contextual tab in the Ribbon, instead. Then click the “Run” button in the “Results” button group.

Does SQL Server log queries?

SQL Statements are saved in a list written to a file and/or a database. The solution can delete the older SQL query history logs automatically. Additionally, you can monitor who and when executed any particular query, or receive other valuable information for research and analysis.


1 Answers

The answer depend on the technology used from the client which use MDB. There are different tracing settings which you can configure in HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\ODBC http://office.microsoft.com/en-us/access/HP010321641033.aspx. If you use OLEDB to access MDB from SQL Server you can use DBCC TRACEON (see http://msdn.microsoft.com/en-us/library/ms187329.aspx). I can continue, but before all you should exactly define which interface you use to access MDB.

MDB is a file without any active components, so the tracing can makes not MDB itself, but the DB interface only.

UPDATED: Because use use DAO (Jet Engine) and OLE DB from VB I recommend you create JETSHOWPLAN regisry key with the "ON" value under HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\JET\4.0\Engines\Debug (Debug subkey you have to create). This key described for example in https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5064388.html, http://msdn.microsoft.com/en-us/library/aa188211%28office.10%29.aspx and corresponds to http://support.microsoft.com/kb/252883/en allow trace OLE DB queries. If this output will be not enough for you you can additionally use TraceSQLMode and TraceODBCAPI from HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\ODBC. In my practice JETSHOWPLAN gives perfect information for me. See also SHOWPLAN commend.

UPDATED 2: For more recent version of Access (like Access 2007) use key like HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Access Connectivity Engine\Engines. The tool ShowplanCapturer (see http://www.mosstools.de/index.php?option=com_content&view=article&id=54&Item%20%20id=57, to download http://www.mosstools.de/download/showplan_v9.zip also in english) can be also helpful for you.

like image 62
Oleg Avatar answered Sep 17 '22 13:09

Oleg