是否可以监视和记录对Access MDB进行的实际查询? [英] Is it possible to monitor and log actual queries made against an Access MDB?

查看:72
本文介绍了是否可以监视和记录对Access MDB进行的实际查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以以与对SQL Server使用SQL事件探查器相同的方式监视Access MDB发生了什么(即针对它执行了哪些SQL查询)?

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.

推荐答案

答案取决于使用MDB的客户端使用的技术.您可以在HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Jet \ 4.0 \ Engines \ ODBC http ://msdn.microsoft.com/en-us/library/ms187329.aspx ).我可以继续,但是在开始之前,您应该完全定义用于访问MDB的接口.

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是一个没有任何活动组件的文件,因此该跟踪不能使MDB本身,而仅使DB接口成为可能.

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

已更新:由于使用了VB中的DAO(Jet Engine)和OLE DB,因此建议您在HKEY_LOCAL_MACHINE \ SOFTWARE \ MICROSOFT \ JET \ 4.0 \ Engines下创建具有"ON"值的JETSHOWPLAN注册表项\ Debug(您必须创建的调试子项).例如 http://support.microsoft.com/kb/252883/cn 允许跟踪OLE DB查询.如果此输出不足以满足您的要求,则可以另外使用HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Jet \ 4.0 \ Engines \ ODBC中的TraceSQLMode和TraceODBCAPI.在我的实践中,JETSHOWPLAN为我提供了完善的信息.另请参阅SHOWPLAN推荐.

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.

更新2 :对于Access的最新版本(如Access 2007),请使用HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Access Connectivity Engine\Engines之类的密钥.工具ShowplanCapturer(请参阅 http://www.mosstools.de/index.php?option=com_content&view=article&id=54&Item%20%20id=57 ,以下载

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.

这篇关于是否可以监视和记录对Access MDB进行的实际查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆