Another way to specify connection parameters in a script is by coding PowerScript to assign values to properties of the Transaction object. As explained in Chapter 16, “Using Transaction Objects,” PocketBuilder 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.
To set values for the DBParm property in a PocketBuilder script:
Open the application script in which you want to specify connection parameters.
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.
SQLCA.dbParm = "parameter_1, parameter_2, parameter_n"
For example, the following statement in a 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.
SQLCA.dbParm="ConnectString='DSN=Sales;UID=PB;
PWD=xyz',Async=1"
Compile the script to save your changes.