Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Starting ODBC Driver Manager Trace in a PowerBuilder application – PB Docs 2019 – PowerBuilder Library

Starting ODBC Driver Manager Trace in a PowerBuilder application – PB Docs 2019

Starting ODBC Driver Manager Trace in a PowerBuilder
application

To start ODBC Driver Manager Trace in a PowerBuilder
application, you must specify certain values for the ConnectOption
DBParm parameter in the appropriate script. For example, you might
include them in the script that opens the application.

You can specify the required ConnectOption values in a
PowerBuilder script by:

  • (Recommended) Copying the PowerScript ConnectOption DBParm
    syntax from the Preview tab in the Database Profile Setup dialog
    box into your script

  • Coding PowerScript to set a value for the DBParm property of
    the Transaction object

  • Reading the DBParm values from an external text file

For more about using Transaction objects to communicate with a
database in a PowerBuilder application, see the section called “Using Transaction Objects” in Application Techniques.

About the ConnectOption DBParm
parameter

ConnectOption includes several parameters, two of which control
the operation of ODBC Driver Manager Trace for any ODBC-compatible
driver you are using in PowerBuilder.

Parameter

Description

SQL_OPT_TRACE

Purpose

Starts or stops
ODBC Driver Manager Trace in
PowerBuilder.

Values

The values you can
specify are:

  • SQL_OPT_TRACE_OFF

    (Default) Stops ODBC Driver Manager Trace

  • SQL_OPT_TRACE_ON

    Starts ODBC Driver Manager Trace

SQL_OPT_TRACEFILE

Purpose

Specifies the name
of the trace file where you want to send the output of ODBC
Driver Manager Trace. PowerBuilder appends the output to the
trace file you specify until you stop the trace. To display
the trace file, you can use the File Editor (in PowerBuilder)
or any text editor (outside
PowerBuilder).

Values

You can specify any
filename for the trace file, following the naming conventions
of your operating system. By default, if tracing is on and you
have not specified a trace file, PowerBuilder sends ODBC
Driver Manager Trace output to a file named
SQL.LOG.

For information about the location of
SQL.LOG on different platforms, see About ODBC Driver
Manager Trace
.

Copying ConnectOption syntax from the
Preview tab

The easiest way to start ODBC Driver Manager Trace in a
PowerBuilder application script is to copy the PowerScript
ConnectString DBParm syntax from the Preview tab in the Database
Profile Setup – ODBC dialog box into your script, modifying the
default Transaction object name (SQLCA) if necessary.

As you complete the Database Profile Setup dialog box in the
development environment, PowerBuilder generates the correct connection
syntax on the Preview tab. Therefore, copying the syntax directly from
the Preview tab into your script ensures that it is accurate.

To copy ConnectOption syntax from the Preview tab into your
script:

  1. On the Options tab in the Database Profile Setup – ODBC
    dialog box for your connection, select the Trace ODBC API Calls
    check box and (optionally) specify a log file in the Trace File
    box to start ODBC Driver Manager Trace.

  2. Click Apply to save your changes to the Options tab without
    closing the dialog box.

  3. Click the Preview tab.

    The correct PowerScript syntax for ODBC Driver Manager Trace
    and other selected options displays in the Database Connection
    Syntax box.

    The following example shows the PowerScript syntax that
    starts ODBC Driver Manager Trace and sends output to the file
    C:TEMPODBCTRCE.LOG.

  4. Select the SQLCA.DBParm line and any other syntax you want
    to copy to your script and click Copy.

    PowerBuilder copies the selected text to the
    clipboard.

  5. Paste the selected text from the Preview tab into your
    script, modifying the default Transaction object name (SQLCA) if
    necessary.

Coding PowerScript to set a value for the
DBParm property

Another way to start ODBC Driver Manager Trace in a
PowerBuilder application script is to include the ConnectOption
parameters that control tracing as values for the DBParm property of
the Transaction object.

To start ODBC Driver Manager Trace by setting the DBParm
property:

  • In your application script, set the SQL_OPT_TRACE and
    (optionally) SQL_OPT_TRACEFILE ConnectOption parameters to start
    the trace and to specify a nondefault trace file,
    respectively.

    For example, the following statement starts ODBC Driver
    Manager Trace in your application and sends output to a file named
    MYTRACE.LOG. Insert a comma to separate the ConnectString and
    ConnectOption values.

    This example assumes you are using the default Transaction
    object SQLCA, but you can also define your own Transaction
    object.

Reading the DBParm value from an external
text file

As an alternative to setting the DBParm property in your
PowerBuilder application script, you can use the PowerScript
ProfileString function to read DBParm values from a specified section
of an external text file, such as an application-specific
initialization file.

This assumes that the DBParm value read from your initialization
file includes the ConnectOption parameter to start ODBC Driver Manager
Trace, as shown in the preceding example.

To start ODBC Driver Manager Trace by reading DBParm values
from an external text file:

  • Use the following PowerScript syntax to specify the
    ProfileString function with the DBParm property:

    For example, the following statement in a
    PowerBuilder script reads the DBParm values from the [Database]
    section of the APP.INI file:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x