Defining multiple data sources for the same data

When you define an ODBC data source in PowerBuilder, each data source name must be unique. You can, however, define multiple data sources that access the same data, as long as the data sources have unique names.

For example, assume that your data source is a SQL Anywhere database located in C:\SQL Anywhere\SALES.DB. Depending on your application, you might want to specify different sets of connection parameters for accessing the database, such as different passwords and user IDs.

To do this, you can define two ODBC data sources named Sales1 and Sales2 that specify the same database (C:\SQL Anywhere\SALES.DB) but use different user IDs and passwords. When you connect to the data source using a profile created for either of these data sources, you are using different connection parameters to access the same data.

Figure 2-4: Using two data sources to access a database

The figure shows two ODBC data sources named Sales1 and Sales2 connected with arrows to the same database, which is located at C: backslash A S A backslash SALES dot D B. Sales 1 has the user ID Smith and password x x x. Sales 2  has the user ID Jones and password y y y.