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

前端 未结 5 695
甜味超标
甜味超标 2020-12-05 10:57

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

5条回答
  •  青春惊慌失措
    2020-12-05 11:44

    If you're accessing it via ODBC, you can turn on ODBC logging. It will slow things down a lot, though. And it won't work for any other data interface.

    Another thought is using Jet/ACE as a linked server in SQL Server, and then using SQL Profiler. But that's going to tell you the SQL that SQL Server processed, not what Jet/ACE processed. It may be sufficient for your purposes, but I don't think it would be a good diagnostic for Jet/ACE.

    EDIT:

    In a comment, the original poster has provided this rather crucial information:

    The application I am trying to monitor is compiled and at a customer's premises. I am trying to monitor what queries it is attempting against an MDB. I cannot modify the application. I am trying to do what SQL Profiler would do for a SQL Server.

    In that case, I think that you could do this:

    1. rename the original MDB to something else.

    2. use a SQL Server linked server to connect to the renamed MDB file.

    3. create a new MDB with the name of the original MDB and link to the SQL Server with ODBC.

    The result will be an MDB file that has the same tables in it as the original, but they are not local, but links to the SQL Server. In that case, all access will be going through the SQL Server and can be viewed with SQL Profiler.

    I don't have a clue what this would do to performance, or if it would break any of the data retrieval in the original app. If that app uses table-type recordsets or SEEK, then, yes, it will break. But this is the only way I can see to get logging.

    It shouldn't be surprising that there is no logging for Jet/ACE, given that there is no single server process managing access to the data store.

提交回复
热议问题