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

Setting DBParm parameters – PB Docs 90 – PowerBuilder Library

Setting DBParm parameters – PB Docs 90

Setting DBParm parameters

In PowerBuilder, you can set DBParm parameters by doing either
of the following:

  • Editing
    the Database Profile Setup dialog box for your connection in the development
    environment
  • Specifying connection parameters in an application
    script

Setting DBParm parameters in the development environment

Editing database profiles

To set DBParm parameters for a database connection in the PowerBuilder development
environment, you must edit the database profile for that connection.

Character limit for DBParm strings

Strings containing DBParm parameters that you specify in the
Database Profile Setup dialog box for your connection can be up
to 999 characters in length.

This limit applies only to DBParm parameters that you set
in a database profile in the development environment. DBParm strings
specified in PowerBuilder scripts as properties of the Transaction
object are not limited to a specified length.

What
you do

You set DBParm parameters in the Database Profile Setup dialog
box for your connection.

Setting DBParm parameters in a PowerBuilder application script

If you are developing a PowerBuilder application that connects
to a database, you must specify the required connection parameters
in the appropriate script as properties of the default Transaction
object (SQLCA) or a Transaction object that you create. For example,
you might specify connection parameters in the script that opens
the application.

One of the connection parameters you may want to specify in
a script is DBParm. You can do this by:

  • (Recommended) Copying PowerScript
    DBParm syntax from the Preview tab in the Database Profile Setup
    dialog box into your script
  • Coding PowerScript to set values for the DBParm
    property of the Transaction object
  • Reading DBParm values from an external text file

Copying DBParm syntax fromthe Preview tab

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

As you set DBParm parameters in 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 ensures that you use the
correct PowerScript DBParm syntax in your script.

proc.gif To copy DBParm syntax from the Preview tab into
your script:

  1. On one or more tab pages in the Database
    Profile Setup dialog box for your connection, supply values for
    any DBParm parameters you want to set.

    For instructions, see “Setting DBParm parameters
    in the development environment”
    .

    For example, the Network tab in the Database Profile Setup
    – Adaptive Server Enterprise dialog box contains settings for network-related DBParm
    parameters that the interface supports. This example shows nondefault
    settings for Application Name (corresponds to the AppName DBParm
    parameter) and Workstation Name (corresponds to the Host DBParm
    parameter):

    cn7syc.gif

    For information about the DBParm parameters
    for your interface and the values to supply, click Help.

  2. Click Apply to save your changes to the current
    tab without closing the Database Profile Setup dialog box.

  3. Click the Preview tab.

    The correct PowerScript DBParm syntax for each selected option
    displays in the Database Connection Syntax box. For example:

    cn7sycv.gif

  4. Select one or more lines of text in the Database
    Connection Syntax box and click Copy.

    PowerBuilder copies the selected text to the clipboard.

  5. Click OK to close the Database Profile Setup dialog
    box.

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

Coding PowerScript to set values for the DBParm
property

Another way to specify connection parameters in a script is
by coding PowerScript to assign values to properties of the Transaction
object. PowerBuilder uses a special nonvisual object called a Transaction
object
to communicate with the database. The default
Transaction object is named SQLCA, which stands for SQL Communications
Area.

SQLCA has 15 properties, 10 of which are used to connect to
your database. One of the 10 connection properties is DBParm. DBParm
contains DBMS-specific parameters that let your application
take advantage of various features supported by the database interface.

proc.gif To set values for the DBParm property in a PowerBuilder script:

  1. Open the application script in which you
    want to specify connection parameters.

    For instructions, see the User’s
    Guide

    .

  2. Use the following PowerScript syntax to specify
    DBParm parameters. Make sure you separate the DBParm parameters
    with commas, and enclose the entire DBParm string in double quotes.

    For example, the following statement in a PowerBuilder script
    sets the DBParm property for an ODBC data source named Sales. In
    this example, the DBParm property consists of two parameters: ConnectString
    and Async.

  3. Compile the PowerBuilder script to save your changes.

    For instructions, see the User’s
    Guide

    .

Reading DBParm values from an external text file

As an alternative to setting the DBParm property in a 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.

proc.gif To read DBParm values from an external text file:

  1. Open the application script in which you
    want to specify connection parameters.

    For instructions, see the User’s
    Guide

    .

  2. Use the following PowerScript syntax to specify
    the ProfileString function with the SQLCA.DBParm
    property:

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

  3. Compile the script to save your changes.

    For instructions, see the User’s
    Guide

    .


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