![]() |
|
Debugging a DataBlade module is usually an iterative process, repeated many times until the code is completely debugged. The "Creating a Simple User-Define Routine" exercise in the DBDK InfoShelf tutorial guides you through this process.
The debugging process on a local database server has the following general steps:
The following sections describe some of these steps.
Important: If you attempt to start or stop the database server with the Services dialog box of the Control Panel during debugging, you receive an error. When the add-in starts the database server attached to the debugger, the database server does not run as a Windows NT service. To stop the database server, shut down the debugger.
Manually Loading the Add-In
The DBDK Visual C++ Add-In toolbar should be present in the Visual C++ program if you installed DBDK after you installed Visual C++. If it is not present, you must add it manually.
To debug a project, each DataBlade module project must have an associated database server and database.
When you first open a DataBlade module project in Visual C++, the Configure DBDK Visual C++ dialog box appears, prompting you to choose a database server and database. If you choose a local database server, you can use any of the add-in commands. If you choose a remote database server, you can use only the Upload DataBlade Module, Upload DataBlade SQL Scripts, and Register DataBlade Module commands.
You can choose an existing database from the DBDK Database list or, if you are using a local database server, type in a new database name. IfxQuery creates the database you specify if it does not exist when you run the Debug DataBlade Module command. If the database server you specified is a remote server, you must choose an existing database name.
You can also specify an SQL file to initialize your test database for the project in the Initialize Database File field. You can use the generated Setup.sql file in the src directory as your initialization file after you add SQL statements to it. See Editing Unit Test Files for a description of the Setup.sql file.
You can change the properties of a project at any time by clicking Configure DBDK Visual C++ Add-In button and completing the corresponding dialog box.
Before you start the debugger, set breakpoints in your source code.
Before you start debugging, edit the unit test files to add the SQL statements necessary to debug your DataBlade module.
When you generate unit tests for a DataBlade module, BladeSmith generates the files listed in the following table in the src\tests directory.
When you edit unit test files, add SQL statements in the areas marked with TEST comments. This ensures that your statements are merged when you regenerate unit tests with BladeSmith.