Create the database profile for the Appeon Sample database

After you install PowerServer Mobile, the Appeon Sample database is automatically installed and defined as a data source in the ODBC Administrator. You use the Appeon Sample database in this tutorial.

Appeon Sample is a SQL Anywhere database that is accessed through ODBC. In this section you create the database profile for the Appeon Sample database. PowerBuilder stores database profile parameters in the registry.

  1. Click the Database Profile () button in the PowerBar


    Select Tools > Database Profile from the menu bar.

    PowerBuilder displays the Database Profiles dialog box, which includes a tree view of the installed database interfaces and defined database profiles for each interface. You can click the + signs or double-click the icons next to items in the tree view to expand or contract tree view nodes.

  2. Select ODB ODBC in the tree view of the Database Profiles dialog box and click New.

    PowerBuilder displays the Connection tab of the Database Profile Setup dialog box.

  3. On the Connection tab of the Database Profile Setup dialog box, select the AppeonSample data source from the Data Source drop-down list and type AppeonSample in the Profile Name text box.

    Figure 34. Connection tab

    Connection tab

  4. Select the Preview tab.

    The PowerScript connection syntax for the profile is shown on the Preview tab. If you change the profile connection options, the syntax changes accordingly.

    Figure 35. Preview tab

    Preview tab

  5. Click the Test Connection button.

    A message box tells you that the connection is successful. Click OK to close the message box.

    If the message box tells you the connection is not successful

    Close the message box and verify that the information on the Connection page of the Database Profile Setup dialog box is correct. Then check the configuration of the data source in the ODBC Administrator. You can run the ODBC Administrator by expanding the Utilities folder under the ODB ODBC node of the Database Profile painter and double-clicking the ODBC Administrator item.

  6. Click OK to close the Database Profile Setup dialog box. The AppeonSample database profile is created under the ODB ODBC node.

  7. Select the AppeonSample database profile and click Connect.

    What happens when you connect

    When you connect to a database in the development environment, PowerBuilder writes the connection parameters to the Windows registry. Each time you connect to a different database, PowerBuilder overwrites the existing parameters in the registry with those for the new database connection. When you open a PowerBuilder painter that accesses the database, you automatically connect to the last database used. PowerBuilder determines which database this is by reading the registry.

  8. Click Close to close the Database Profiles dialog box.