• No results found

Using the Database Profile Painter

Detailed Instructions

Task 3: Using the Database Profile Painter

1. The Database Profile painter is where you set up profiles that allow the IDE to have a design-time connection to your database. Design-time connections are needed if you create DataWindow objects, Query objects, put embedded SQL into events or functions, etc.

2. Click on ToolsÆDatabase Profile… or click the DB Profile icon on the PowerBar. You also set up a keyboard shortcut which was Ctrl-Shift-D.

3. The DB Profile painter has a tree view showing installed database interfaces. You must know which DBMS and how you plan to connect in order to choose the correct interface. For instance, a developer connecting to Microsoft SQL Server 2005 could choose from several interfaces: SNC, ADO.NET, OLE-DB or ODBC. The choice of interface is a decision you have to make.

Task 3: Using the Database Profile Painter

1. The Database Profile painter is where you set up profiles that allow the IDE to have a design-time connection to your database. Design-time connections are needed if you create DataWindow objects, Query objects, put embedded SQL into events or functions, etc.

2. Click on ToolsÆDatabase Profile… or click the DB Profile icon on the PowerBar. You also set up a keyboard shortcut which was Ctrl-Shift-D.

3. The DB Profile painter has a tree view showing installed database interfaces. You must know which DBMS and how you plan to connect in order to choose the correct interface. For instance, a developer connecting to Microsoft SQL Server 2005 could choose from several interfaces: SNC, ADO.NET, OLE-DB or ODBC. The choice of interface is a decision you have to make.

4. PowerBuilder ships with a developer edition of Sybase SQL Anywhere 11, our Mobile and Embedded database. In addition, PowerBuilder ships with a sample database named EAS Demo DB V120. This database contains tables with customers, products, employees, orders, etc. PowerBuilder installs a DB Profile for the EAS Demo DB V120 automatically:

5. Expand the ODBC node and you will see the EAS Demo DB V120 profile. Right- click over that profile and select Connect… from the context menu. If you receive no errors, then you are successfully connected.

4. PowerBuilder ships with a developer edition of Sybase SQL Anywhere 11, our Mobile and Embedded database. In addition, PowerBuilder ships with a sample database named EAS Demo DB V120. This database contains tables with customers, products, employees, orders, etc. PowerBuilder installs a DB Profile for the EAS Demo DB V120 automatically:

5. Expand the ODBC node and you will see the EAS Demo DB V120 profile. Right- click over that profile and select Connect… from the context menu. If you receive no errors, then you are successfully connected.

6. Re-open the DB Profile painter and look under the ODBC node again. Your painter should look like the following:

7. Notice the small green checkmark to the left of the EAS Demo DB V120 profile. That mark indicates you are connected.

8. Next, right-click over the EAS Demo DB V120 Unicode profile and select Connect… 9. Re-open DB Profile.

10. Is it possible, at design time (in the IDE), to have concurrent active connections to more than one database?

_____________________________________________________________________ 11. Right-click over EAS Demo DB V120 again. Select Set As Active Connection. Note

how the green check mark is switching with the active connection. 12. Disconnect from any active database.

13. Next, we will set up a DB Profile for the SybHealth database. Remember, that in Module 1’s lab, we created an ODBC DSN to the SybHealth database so that we could run the final solution. That is the first step toward creating an ODBC profile. 14. In the DB Profile painter select the ODBC node. This enables the New… button.

Click New to create a DB Profile.

6. Re-open the DB Profile painter and look under the ODBC node again. Your painter should look like the following:

7. Notice the small green checkmark to the left of the EAS Demo DB V120 profile. That mark indicates you are connected.

8. Next, right-click over the EAS Demo DB V120 Unicode profile and select Connect… 9. Re-open DB Profile.

10. Is it possible, at design time (in the IDE), to have concurrent active connections to more than one database?

_____________________________________________________________________ 11. Right-click over EAS Demo DB V120 again. Select Set As Active Connection. Note

how the green check mark is switching with the active connection. 12. Disconnect from any active database.

13. Next, we will set up a DB Profile for the SybHealth database. Remember, that in Module 1’s lab, we created an ODBC DSN to the SybHealth database so that we could run the final solution. That is the first step toward creating an ODBC profile. 14. In the DB Profile painter select the ODBC node. This enables the New… button.

15. Set the Profile Name to SybHealth. Select the SybHealth Data Source (this is the DSN we created in Lab 1) using the drop down.

16. Click OK.

17. Connect using the SybHealth profile.

15. Set the Profile Name to SybHealth. Select the SybHealth Data Source (this is the DSN we created in Lab 1) using the drop down.

16. Click OK.