ColdFusion Muse

Tricky Event Log Problem Due To ODBC Performance Counters

Mark Kruger October 31, 2005 12:13 PM Coldfusion Troubleshooting Comments (3)

I've seen this error several times, but it happens so infrequently I always forget the solution. I thought I would record it here for posterity. If you have a Win2K box with a some ODBC databases installed you might may have seen an error appearing in your "application" log in the event viewer. The error is actually a pair of messages that occur together each second. The error is cryptic but seems to indicate trouble finding performance counters for ODBC.

The 2 errors are as follows. First there is the marker:

The Open Procedure for service "ODBC" in DLL C:\WINNT\system32\ODBC32.DLL" failed. Performance data for this service will not be available. Status code returned is data DWORD 0.
Then there is a more verbose description in the very next entry (your file paths will probably be different).
The description for Event ID ( 0 ) in Source ( ODBC ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: Error in d:\mdac28rtm\odbc\core\dm\perf.c(522), The system cannot find the file specified.
: Failed to query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ ODBC\Performance\First Counter.

Although the error occurs each second it does not seem to have an appreciable performance impact. It can fill up your application log however, which will definitely cause other issues. On a busy server with lots of events it can even cause corruption in the application log. So it is probably a good idea to take care of it. It also makes it very difficult to sort out other errors from among the thousands of PerfMon ODBC errors.

The Fix

From the Desktop go to START-->PROGRAMS-->ADMINISTRATIVE TOOLS-->Data Sources (ODBC) and click on the "Connection Pooling" tab at the top. In the upper right hand of the dialog box you will see an item that says "PerfMon" with a radio button to enable or disable. Set it to "enable". This will set the correct registry entries and cause the counters to load - thus taking away your error.

Of course this is a bit kludgy. There should be a way to disable the error message from firing at all. After all if you want the PerfMon counters to be disabled then the system shouldn't complain that it can't load the counters - right? Still, this will save you a lot of headaches in the long run. Why are you still using ODBC anyway? Oh yeah... Access :)

  • Share:


  • ncambronero's Gravatar
    Posted By
    ncambronero | 10/24/06 11:01 AM
    And what do you suggest to use in place of ODBC?
  • Daniel S. Gurrola II's Gravatar
    Posted By
    Daniel S. Gurrola II | 9/16/10 4:10 PM
    Instead, if you do not want ODBC counters enabled, leave the setting Mark suggests left at disabled.

    Open your registry editor and delete the "Performance" key from HKLM\SYSTEM\CurrentControlSet\Services\ODBC\

    You get this event pair when you enable the PerfMon option and then disable it and later open Perfmon.

    Re-enabling the setting in the Data Sources (ODBC) applet will reset the deleted values from the registry.
  • Max's Gravatar
    Posted By
    Max | 9/20/10 4:15 AM
    Excellent, thanks! :)