Debugging Embedded SQL Programs

You can use the Microsoft debuggers (including the integrated debugger in 16-bit Visual C++ and 32-bit Visual C++), CodeView® window-oriented debugger for Windows, and WinDebug for Windows NT and Windows 95 to examine your Embedded SQL program while it is executing. A Microsoft debugger displays Embedded SQL source statements as lines of executable code. While debugging, you can set breakpoints on Embedded SQL statements to test host variables. To monitor SQLCA and SQLDA fields, you must monitor the SQLCA and SQLDA data structures and member variables. For example, you must monitor sqlca->sqlcode instead of the SQLCODE macro, and you must monitor sqlca->sqlerrd[0] instead of the SQLERRD1 macro.

When you use the integrated debugger in 16-bit Visual C++ or 32-bit Visual C++, you can set breakpoints on lines of source code in your .SQC file. However, to begin a debugging session, you must first open the .C file that is generated by sqlprep and make that window active. Then from the Debug menu, choose Go.

When you use CodeView for 16-bit Windows and step through the code, the cursor disappears until it reaches the next C statement.