Sharing database profiles
When you work in the PowerBuilder development environment on any
supported
platform, you can share database profiles among users on the same platform
or between PowerBuilder and InfoMaker running on the same computer.
This section describes what you need to know to set up, use,
and maintain shared database profiles in PowerBuilder.
About shared database profiles
What you can do
You can share database profiles in the PowerBuilder development
environment by specifying the location of the initialization file
containing the profiles you want to share. You specify this location
in the Database Preferences property sheet in the Database painter.
Where to store the initialization file
Where you store the initialization file determines how you
can share the profiles it contains:
To share database profiles | Store the initialization file |
---|---|
Among all PowerBuilder users at your site | On a network file server accessible to all users |
Between PowerBuilder and InfoMaker when both products are running on your computer |
In a directory or folder on your computer (typically the PowerBuilder or InfoMaker product directory) |
Initialization filename and location
For information about the default names and
locations of the PowerBuilder and InfoMaker initialization files
on different platforms, see “Initialization files
on different platforms”.
What happens
When you share database profiles, PowerBuilder displays shared
database profiles from the initialization file you specify as well
as those from your local initialization file. For all other painter
preferences, however, PowerBuilder continues to use your local initialization
file.
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 local changes to
shared database profiles”.)
How to do it
To set up shared database profiles in the PowerBuilder development environment,
you specify the location of the initialization file containing shared
profiles in the Database painter’s Database Preferences
property sheet.
For instructions, see “Setting up shared database
profiles”.
Setting up shared databaseprofiles
Platform considerations
Database profiles are usable on any supported PowerBuilder platform. However,
the ability to read profile information from the initialization
file depends on the platform you are using.
Sharing database profiles on Windows PowerBuilder on Windows platforms cannot read database profile
values from initialization files created on non-Windows platforms
(such as UNIX) unless this information contains native Windows line
endings.
Therefore, make sure the profile information you are sharing either
:
- Originates on the Windows
platform, or - Contains native Windows line endings converted from
another platform
If the database profiles you are sharing come from initialization
files created on other platforms, you must first make a copy of
the initialization file and convert its line endings to Windows
format. You can do this with an appropriate text conversion utility
or by opening the file in the PowerBuilder for Windows text editor
and saving it in the native format.
After converting the line endings to native Windows format,
you can copy the database profiles into the initialization file
on the Windows platform and share the profiles among Windows-based
PowerBuilder and InfoMaker users.
Sharing database profiles on UNIX PowerBuilder on the UNIX platform cannot read database profile
values from initialization files created on other platforms (Windows)
unless this information contains native UNIX line endings.
Therefore, make sure the profile information you are sharing either
:
- Originates on the UNIX platform, or
- Contains native UNIX line endings converted from
another platform
If the database profiles you are sharing come from initialization
files created on other platforms, you must first make a copy of
the initialization file and convert its line endings to UNIX format.
You can do this with an appropriate text conversion utility or by
opening the file in the PowerBuilder for UNIX text editor and saving
it in the native format.
After converting the line endings to native UNIX format, you
can copy the database profiles into the initialization file on the
UNIX platform and share the profiles among UNIX-based PowerBuilder users.
What you do
You set up shared database profiles in the Database Preferences
property sheet.
To set up shared database profiles:
-
In the Database painter, select Design>Options
from the menu bar.The Database Preferences property sheet displays. If necessary,
click the General tab to display the General property page. -
In the Shared Database Profiles box, specify the
location of the initialization file containing the database profiles
you want to share. Do this in either of the following ways:- Type the location (pathname)
in the Shared Database Profiles box. - Click the Browse button to navigate to the initialization
file location and display it in the Shared Database Profiles box.
In the following example on Windows, I:SHAREPB.INI
is the location of the initialization file containing the database
profiles to be shared: - Type the location (pathname)
-
Do one of the following:
- Click
Apply to apply the Shared Database Profiles setting to the current
connection and all future connections without closing the Database
Preferences property sheet. - Click OK to apply the Shared Database Profiles setting
to the current connection and all future connections and close the
Database Preferences property sheet.
PowerBuilder saves your Shared Database Profiles setting in
the [PB] section of your local
PowerBuilder initialization
file. - Click
Using shared database profiles to connect
You select a shared database profile to connect to a database
the same way you select a profile stored in your local initialization
file. You can select the shared profile in the Database Profiles
dialog box or from the File>Connect menu.
Database Profiles dialog box
You can select and connect to a shared database profile in
the Database Profiles dialog box.
To select a shared database profile in the Database
Profiles dialog box:
-
Click the Database Profile button in the
PowerBar.or
Select Windows>Database Profile from the PowerBar.
The Database Profiles dialog box displays listing both shared
and local profiles. Shared profiles are denoted by a network icon
and the word (Shared)
. -
Select the name of the shared profile you want
to access and click Connect.PowerBuilder connects to the selected database and returns you
to the painter workspace.
Making local changes toshared database profiles
Because shared database profiles can be accessed by multiple
users running PowerBuilder, you should not make changes to these profiles.
However, if you want to modify and save a copy of a shared database
profile for your own use
, you can edit the
profile and save the modified copy in the local PowerBuilder initialization
file on your computer.
To save changes to a shared database profile in
your local PowerBuilder initialization file:
-
In the Database Profiles dialog box, select
the shared profile you want to edit and click the Edit button.Shared profiles are denoted by a network icon and the word (Shared)
. -
In the Database Profile Setup dialog box that
displays, edit the profile values as needed and click OK.A message box displays asking if you want to save a copy of
the modified profile to your computer. -
Click Yes.
PowerBuilder saves the modified profile in the local PowerBuilder initialization
file on your computer:
Maintaining shared database profiles
If you maintain the database profiles for PowerBuilder at your
site, you may 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 PowerBuilder on different platforms, 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.
To maintain shared database profiles at your site:
-
Make and save required changes to the shared
profiles on your own computer.These changes are saved in your local PowerBuilder initialization
file.For instructions, see “Making local changes to
shared database profiles”. -
Copy the [DBMS_PROFILES] section
and any updated profile entries from your local initialization file
to the existing initialization file containing shared profiles. -
If they have not already done so, have each user
specify the location of the new PowerBuilder initialization file in
the Database Preferences property sheet so they can access the updated
shared profiles on their computer.For instructions, see “Setting up shared database
profiles”.