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.