Producing the database trace in the Database Interface Designer

About this task

Click the Trace tool or select Trace from the File menu to enable a database trace file (.dbl). If trace is enabled, a database trace file is automatically created when you generate a type tree. This file is placed in the same directory as the currently open MDQ file. The newly created database trace file is named using the full name of the MDQ file plus a .dbl extension. For example, if your MDQ file is named Orders.mdq, the trace file is named Orders.dbl and is located in the same directory. If your MDQ file is not yet named, the trace file is named Database_QueryFile 1 .dbl and resides in the same directory, typically the default installation directory.

Most problems encountered in the Database Interface Designer are relayed to the user in message dialogs. For example, if an incorrect user-ID or password is specified for a database, a dialog appears when attempting to generate type trees for tables in that database. The following example dialog reports an Oracle error ORA-01017 with the following message as returned by the database driver to the database adapter:

invalid username/password; logon denied

If trace is enabled when the message in this dialog appears, a corresponding message is also written to the database trace file ( .mdq_file_name .dbl).

The following is a sample of a database trace file when generating a type tree that describes two tables in an Oracle database.

The contents of any trace file are database platform-specific.

<1776-940>:  Datalink: bocadb2\\Northwind
<1776-940>:  UserId  : test
<1776-940>:  Password:****
<1776-940>:  No existing connection was found.
<1776-940>:  Local transaction usage: Transaction ID 0x019287F4
<1776-940>:  Transaction started - ISOLATIONLEVEL_READCOMMITTED
<1776-940>:  Connection to SQL Server bocadb2 has been established.
<1776-940>:  Retrieving 1 rows per fetch.
<1776-940>:  The columns are of the following types:
<1776-940>:  Column 1 (CustomerID) type is nchar(5) [DBTYPE_WSTR].
<1776-940>:  Column 2 (CompanyName) type is nvarchar(40) [DBTYPE_WSTR].
<1776-940>:  Column 3 (ContactName) type is nvarchar(30) [DBTYPE_WSTR].
<1776-940>:  Column 4 (ContactTitle) type is nvarchar(30) [DBTYPE_WSTR].
<1776-940>:  Column 5 (Address) type is nvarchar(60) [DBTYPE_WSTR].
<1776-940>:  Column 6 (City) type is nvarchar(15) [DBTYPE_WSTR].
<1776-940>:  Column 7 (Region) type is nvarchar(15) [DBTYPE_WSTR].
<1776-940>:  Column 8 (PostalCode) type is nvarchar(10) [DBTYPE_WSTR].
<1776-940>:  Column 9 (Country) type is nvarchar(15) [DBTYPE_WSTR].
<1776-940>:  Column 10 (Phone) type is nvarchar(24) [DBTYPE_WSTR].
<1776-940>:  Column 11 (Fax) type is nvarchar(24) [DBTYPE_WSTR].

The following example was received when attempting to run a map to retrieve data from a table in an SQL Server database.

<1324-3020>: Validating the adapter command...
<1324-3020>: Database type is MS SQL Server 7
<1324-472>:  Connecting...
<1324-472>:  Datalink: MY_2000_SERVER\\test
<1324-472>:  UserId  : test
<1324-472>:  Password:****
<1324-472>:  OLE DB Error code: 0x80004005
<1324-472>:  [DBNMPNTW]Specified SQL server not found.
<1324-472>:  Returned status: (-3) No error text found

In this example, the following lines:

<1324-472>: OLE DB Error code: 0x80004005
<1324-472>: [DBNMPNTW]Specified SQL server not found.

indicate the OLE DB provider-specific error code and the corresponding error description. The last line (beginning with Returned status:) indicates the error code returned by the adapter that caused the map to fail.

This information can be used, along with the SQL Server documentation, to resolve the problem. In this particular example, the error was caused by typing the incorrect server name in the SQL Server Server settings in the Database Definition dialog, rather than by selecting the name from the list of servers. In this example, the server name was incorrectly entered as MY_2000_SERVER, instead of its actual name (MY_2000_SRVR).