Sharing database profiles

When you work in PocketBuilder, you can share database profiles among users. This section describes what you need to know to set up, use, and maintain shared database profiles in PocketBuilder.

About shared database profiles

You can share database profiles in the PocketBuilder development environment by specifying the location of a file containing the profiles you want to share. You specify this location in the Database Preferences dialog box in the Database painter.

To share database profiles among all PocketBuilder users at your site, store a profile file on a network file server accessible to all users. This shared profile file contains two profiles:

[DBMS_PROFILES]
Profiles=Sales, Orders
[Profile Sales]
DBMS=ODBC
DBParm=ConnectString='DSN=Sales;UID=dba;PWD=sql'
Prompt=FALSE
AutoCommit=FALSE
[Profile Orders]
DBMS=ODBC
DBParm=ConnectString='DSN=Orders;UID=;PWD=sql'
Prompt=FALSE
AutoCommit=FALSE

When you share database profiles, PocketBuilder displays shared database profiles from the file you specify as well as those from your registry.

Shared database profiles are read-only. You can select a shared profile to connect to a database, but you cannot edit, save, or delete profiles that are shared. You can, however, make changes to a shared profile and save it on your computer, as described in “Making a local copy of a shared database profile”.

Setting up shared database profiles

To set up shared database profiles in PocketBuilder, you specify the location of the file containing shared profiles in the Database painter’s Database Preferences dialog box.

StepsTo set up shared database profiles:

  1. In the Database painter, select Design>Options from the menu bar.

    The Database Preferences dialog box displays. If necessary, click the General tab to display the General property page.

  2. In the Shared Database Profiles box, specify the location of the file containing the database profiles you want to share. Do this in either of the following ways:

    In the following example, I:\SHARE\dbprofs.ini is the name and location of the file containing the database profiles to be shared:

    Figure 13-3: Specifying shared database profiles

    The sample shows the General tab page of the Database Preferences dialog box. At top is an Applicaiton area with a box labeled Shared Database Profiles. Selected is the profile I : backslash Share backslash P B dot I N. Next are Painter Options with selected check boxes for Connect to Default Profile, Keep Connection Open, and Use Extended Attributes. A check box for Read Only is cleared. A field labeled Columns in Table Display shows the entry 8, sequel Terminator Character displays a semicolon, and Refresh Table List is set to 1800 Seconds. At bottom is a default button.
  3. Click OK to apply the Shared Database Profiles setting to the current connection and all future connections and close the Database Preferences dialog box.

    PocketBuilder saves your Shared Database Profiles setting in the registry.

You select a shared database profile to connect to a database the same way you select a local profile. The Database Profiles dialog box lists both shared and local profiles. Shared profiles are denoted by a network icon and the word (Shared).

Figure 13-4: Shared database profiles in the Database Profiles dialog box

The sample shows the Database Profiles dialog box with Installed Database Interfaces displayed in tree format. The entry for O D B O D B C is expanded. It lists a  profile for A S A demo, Orders ( Shared ), and Sales ( Shared ).

Making a local copy of a shared database profile

Because shared database profiles can be accessed by multiple users running PocketBuilder, you cannot make changes to these profiles. However, you can modify and save a copy of a shared database profile for your own use.

Select the profile in the Database Profiles dialog box, click Edit, and modify the profile. When you click OK to save your changes, PocketBuilder pops up a response window asking if you want to save a copy of the profile to your local machine. When you click OK, PocketBuilder saves the modified copy in your computer’s registry. Both profiles display in the Database Profiles dialog box.

Maintaining shared database profiles

If you maintain the database profiles for PocketBuilder at your site, you might need to update shared database profiles from time to time and make these changes available to your users.

Because shared database profiles can be accessed by multiple users running PocketBuilder, it is not a good idea to make changes to the profiles over a network. Instead, you should make any changes locally and then provide the updated profiles to your users.

StepsTo maintain shared database profiles at your site:

  1. Make and save required changes to the shared profiles on your own computer. These changes are saved in your registry.

  2. Export the updated profile entries from your registry to the existing file containing shared profiles.

    For instructions, see “Importing and exporting database profiles”.

  3. If they have not already done so, have users specify the location of the new profiles file in the Database Preferences dialog box so that they can access the updated shared profiles on their computers.