Mathias
Mathias

Reputation: 34251

Best way to debug an ODBC driver on Windows

What is the best way to debug a custom ODBC driver on Windows? A former member of our team wrote the driver so we have the source available.

How do you attach a debugger to the driver? Or is it easier to just add "trace prints" to the driver to see what is going on?

Upvotes: 3

Views: 10980

Answers (4)

Mathias
Mathias

Reputation: 34251

The best solution i found so far is a combination of trace prints and breakpoints (int 3) compiled into the driver.

Trace prints for general debug information and the breakpoints for pieces of the code where I need to more thoroughly investigate the inner state of the driver.

Upvotes: 3

Florian
Florian

Reputation: 920

Supportingly to VS you could use WireShark to see what the ODCB driver is sending to the DB.

Upvotes: 0

Grey Panther
Grey Panther

Reputation: 13118

As far as I know, ODBC drivers are just DLL's which implement a specific set of functions. So if you have the sources available, you can use Visual Studio to debug it. Here is an article which seems to be something in the right directions: Debugging DLL Projects in Visual Studio 2005.

Upvotes: 1

Milan Babuškov
Milan Babuškov

Reputation: 61148

You can debug any ODBC driver by activating the logging for it via the Control Panel.

Just go to driver's properties, activate the logging and set the target log file - and then set up another program to read from it interactively, so you can see what's going on.

Upvotes: 1

Related Questions