Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / desktop / Win32

A 64 Bit Version of ODBCTracer

0.00/5 (No votes)
7 Sep 2012CPOL1 min read 10.1K  
This is an alternative for ODBCTracer

Introduction 

This article describes my updates to Mr. Doga Arinir's ODBCTracer. ODBC Tracing is a feature of Windows that captures all ODBC calls to a log file.

Background   

In 2005 Mr Doga Arinir shared his creation ODBCTracer, an alternative tracing DLL for ODBCAD32.exe, the Windows ODBC Administration Tool. This week I had a need for ODBC tracing and became aware of it. However, I needed to make some updates to it to get it to work for me.

Problems  

ODBCTracer was written in a 32 bit world, and my laptop runs the 64 bit version of Windows 7. I had to upgrade the code to compile on Visual Studio 2008 (I have 2010 but was purposefully conservative). Initially, the code would not even compile to 64 bits. The compiler errors were pretty trivial. All issues stemmed around TYPEDEFs that were identical on 32 bit windows being different on 64 bit Windows. I also cleaned up the upgraded csproj file so everything landed in the right folder. I also fixed the postdeploy script so the DLL was properly copied to  the system32 or syswow64 folder depending on the build target and machine architecture.  

Source Code on Github 

I have kept my changes on in a GitHub repo. Please refer to that for the latest version of my fork. 

References

Future Directions  

I noticed that this DLL does not trace all ODBC API calls. I plan on fixing that. Also, I would like to write my own ODBC trace DLL in C# with this cool hack.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)