Configuring ODBC data source

An ODBC data source stores the parameters used to connect to the indicated data provider through the Open Database Connectivity interface. By setting up the ODBC data source that identifies the SAP ASA/SQL Anywhere database file for the Appeon tutorial PowerBuilder application, the tutorial application is able to establish a connection with the SAP ASA/SQL Anywhere database through a reference to the ODBC data source name.

To set up the ODBC data source for the tutorial application:

Step 1: Select Tools > Database Profile from the PowerBuilder menu bar, and the Database Profiles dialog box displays.

Figure 15. Database Profiles

Database Profiles

Step 2: Choose ODB ODBC > Utilities, and then double click ODBC Administrator.

Figure 16. Database Profiles

Database Profiles

Step 3: Select the System DSN tab in the ODBC Data Source Administrator dialog box and click Add.

Figure 17. ODBC Data Source Administrator

ODBC Data Source Administrator

Step 4: Select the SQL Anywhere 10 driver to connect to the appeontutor.db database file. Select SQLAnywhere 10 and click Finish in the Create New Data Source dialog box.

Figure 18. Create a Data Source

Create a Data Source

Step 5: The ODBC Configuration for SQL Anywhere dialog box is displayed. Type the necessary settings into the different tabs as specified in the following table, and leave other fields at their default settings.

Table 16. Data source settings

In this tab...

In this field...

You should...

ODBC

Data source name

Type appeontutor

Login

User ID

Type dba (case sensitive)

Password

Type sql (case sensitive)

Database

Server name

Type appeontutor

Database name

Type appeontutor

Database file

Click Browse to select the AppeonSample.db file. For example, C:\Users\Public\Documents\Appeon\Developer2015\appeondemo\Database\AppeonSample.db.


Figure 19. ODBC tab

ODBC tab

Figure 20. Login tab

Login tab

Figure 21. Database tab

Database tab

Step 6: Go back to the ODBC tab and click Test Connection. Ensure the connection test is successful before continuing.

Step 7: Click OK to close the ODBC Configuration for SQL Anywhere dialog box.

The appeontutor is added as a system data source under the System DSN tab.

Step 8: Click OK to close the dialog box and click Close to exit the Database Profiles dialog box.

Figure 22. ODBC Data Source Administrator

ODBC Data Source Administrator