Watcom 4.0
\The Sandbox \PB History & Future \New in PB 4 \DB Enhancements \Watcom 4.0
Array Fetches
in Oracle 7
Bind Variables
Cached
Statements
Select & DB
Painters
Remote Procedure
Informix
ODBC
Oracle 7
Peformance
Gains
Cache in
Oracle
SQL Server
System 10
Watcom 4.0

This section describes how to prepare and define a Watcom SQL data source in order to connect to it from PowerBuilder or InfoMaker using the Watcom SQL ODBC driver.

Supported versions

The Watcom SQL ODBC driver supports connection to Watcom SQL databases created with the following:

  • PowerBuilder or InfoMaker running on your computer
  • Watcom SQL for Windows Version 3.2 or higher
  • Watcom SQL Network Server Edition Version 3.2 or higher

Supported SQL operations

The Watcom SQL ODBC driver supports the following SQL operations with Watcom SQL data sources:

ALTER TABLE

CREATE VIEW

CREATE INDEX

DELETE INDEX

CREATE PRIMARY KEY

DELETE TABLE

CREATE TABLE

UPDATE

Preparing to use the data source

Before you define and connect to a Watcom SQL data source from PowerBuilder or InfoMaker, follow these steps to prepare the data source.

To prepare a Watcom SQL data source:

  1. Make sure the database file for the Watcom SQL data source already exists.
  2. To create a new Watcom SQL database, you can:

  3. Use the Database painter in PowerBuilder or InfoMaker when running these products on your computer. (See the instructions in the PowerBuilder or InfoMaker User's Guide.)
  4. Create the database some other way, such as with PowerBuilder or InfoMaker running on another user's computer, or by using Watcom SQL commands outside PowerBuilder or InfoMaker.
  5. Make sure you have the LOG file associated with the Watcom SQL database.
  6. If the LOG file for the Watcom SQL database does not exist, the Watcom SQL database engine will create it. However, if you are copying or moving a database from another computer or directory, you should copy or move the LOG file with it.

    By keeping the LOG file with the database, you can fully recover the database if it becomes corrupted.

Defining the data source

When you create a Watcom SQL database using PowerBuilder or InfoMaker on your computer, the software automatically defines the data source and creates the database profile for you.

Therefore, you need only use the following procedure to define a Watcom SQL data source when you want to access a Watcom SQL database not created using PowerBuilder or InfoMaker on your computer.

To define a Watcom SQL data source for the Watcom SQL driver:

  1. Select the Watcom SQL driver in the Configure ODBC dialog box.
  2. Click the Create button.
  3. The Watcom SQL ODBC Configuration dialog box appears.

  4. Specify values as follows:
  5. For a detailed description of each field in the Watcom SQL ODBC Configuration dialog box, click the Help button.

Field

Value

Data Source Name

A short name to identify the data source. This becomes the name of the database profile created for this data source.

Description

(Optional) A description of the data source.

User ID

(Optional) The user name used to connect to the data source.

If you omit the user ID, PowerBuilder and InfoMaker prompt you for it when you connect to the data source, unless the UID (user ID) value is already in the ConnectString. (If the ODBC driver returns the UID value when you connect, PowerBuilder or InfoMaker copies this value to the ConnectString DBParm in your database profile.)

Password

(Optional) The password for the specified user ID.

The password is stored in the ODBC.INI file. Therefore, specifying a password here may be a security risk. If you omit the password, PowerBuilder or InfoMaker will prompt you for it when you connect to the data source.

Server Name

The name of a Watcom SQL database engine or Watcom SQL network server.

If you omit the server name, the default local engine is used. This is the first database engine started.

Database Alias

If specified, corresponds to the name of a database already running on a Watcom SQL database engine or Watcom SQL network server.

Database File

If specified, contains the name of a database file (for example, C:\WSQL\TEST.DB).

You can type the file name, or click the Browse button to select the name of an existing database file and display it in this field.

Database Startup

Click one of the following radio buttons to start the Watcom SQL database engine when the named database engine or server is not already running:

  • Local--Start the 32-bit version of the database engine with the default command db32w. If you click Local, you cannot edit this command to add other database switches or startup options. You should select Local if you are using a single-user Watcom SQL database and want to start the engine with the default settings.
  • Network-- Start the database engine with the default command dbclienw. If you click Network, you cannot edit this command to add other database switches or startup options. You should select Network if you are using the Watcom SQL Network Server Edition and want to start the engine with the default settings.
  • Custom--Click Custom and then click the Options button to display the Startup Options dialog box. You should select Custom and complete the Startup Options dialog box if you want to specify nondefault commands, database switches, and options to start the database engine.       

Microsoft Applications (Keys in SQLStatistics)

Not applicable for use with PowerBuilder or InfoMaker.

Prevent Driver not Capable errors

Not applicable for use with PowerBuilder or InfoMaker.

Browse

Click the Browse button to display the Select Database dialog box. When you select an existing Watcom SQL database from the Select Database dialog box and click OK, its fully qualified name displays in the Database File field (for example, C:\WSQL\TEST.DB).

When you use the Browse button, the name of the selected database file (for example, Test) also appears in both the Data Source Name and Database Alias fields. If you want to specify a different name for the data source or database, you can edit one or both of these fields after using the Browse button.

Options

Displays the Startup Options dialog box to specify nondefault commands, database switches, and options to start the database engine.

The Options button is enabled only when you click the Custom button, described earlier in this table.

  1. Click OK to create the data source definition.

Specifying startup options for the database engine

In most cases, you should not have to change the default commands that start the Watcom SQL database engine. These commands are db32w (associated with the Local radio button) and dbclienw (associated with the Network radio button).

Reasons for using nondefault startup options

Sometimes, however, you may need to start the database engine with nondefault commands, database switches, and options. There are several reasons for using nondefault startup options. Some examples are:

  • You want to start the database engine with a command that includes one or more engine switches, or with a command other thandb32w or dbstartw.
  • For example, you can use the -n engine switch to specify a name for the database engine (for example, db32w -n myengine). Or, you can use the dbstartw command to start the 16-bit version of the database engine.

  • You want to specify a database switch.
  • For example, you can use the -n database switch to specify the name of the database file running on a particular engine (for example, -n mydatabase).

    Or, you may want to use the -d database switch to start the database engine using normal DOS input and output (I/O) routines instead of fast (direct) I/O routines. With some hard disk drives, Watcom SQL cannot use its fast I/O routines. The symptom for this is that when you start the database engine, such as by opening the Database painter in PowerBuilder or InfoMaker, the MS-DOS prompt appears and you must reboot your computer. To solve this problem, you can start the engine with the -d switch (for example, db32w -d).

  • You want to use the Autostop Database option to specify whether the database engine or the database running on the engine should stop automatically when you disconnect from the database.

How to specify startup options

Use the following procedure if you need to specify nondefault startup options for the Watcom SQL database engine.

To specify startup options:

  1. In the Watcom SQL ODBC configuration dialog box, click the Custom radio button.
  2. The Options button becomes enabled.

  3. Click the Options button.
  4. The Startup Options dialog box appears.

  5. Specify values as follows:

Field

Value

Start Command

The command you want to use to start the Watcom SQL database engine if it is not already running. For example, enter
db32w -n myengine to start the 32-bit version of the engine with the name myengine.

For more about commands that start the database engine, see the description of DBSTART in Watcom SQL or online Help if you are using PowerBuilder, or in online Help if you are using InfoMaker.

Database Switches

The switch or switches you want to use to specify database-specific options. For example, enter -n mydatabase to specify mydatabase as the name of your database file.

For more about database switches, see the description of DBSTART in Watcom SQL or online Help if you are using PowerBuilder, or in online Help if you are using InfoMaker.

Autostop Database

Select the Autostop Database checkbox if you want the database engine or database running on that engine to stop automatically when you disconnect from the database.

Deselect the Autostop Database checkbox if you do not want the database engine or database running on the engine to stop automatically when you disconnect from the database.

  1. Click OK.
  2. You are returned to the Watcom SQL ODBC Configuration dialog box.

Using local and network connections

The Watcom SQL ODBC driver supports connection to Watcom SQL databases that reside:

  • Locally on your computer--You can create a local Watcom SQL database using PowerBuilder, InfoMaker, or Watcom SQL for Windows.
  • Remotely on a Watcom SQL network server--You can create a network Watcom SQL database using the Watcom SQL Network Server Edition.

The following table compares the values you should specify in the Watcom SQL ODBC Configuration dialog box when accessing local and network Watcom SQL databases.

Field

Value for local database connection

Value for network database connection

Data Source Name

Short name for data source

Short name for data source

Description

Description of data source

Description of data source

User ID

Your user ID

Your user ID

Password

Your password

Your password

Server Name

Name of the Watcom SQL database engine

Name of the Watcom SQL network server

Database Alias

Name of a database already running on a Watcom SQL database engine

Name of a database already running on a Watcom SQL network server

Database File

Name of a database file

Name of a database file

Database Startup

Local
or
Custom

Network
or
Custom

PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com