Connecting to foreign datasources
To run this demo:
1 Create an ODBC datasource to access the dBASE Employee and Department Tables.
2 Click Next Dept and Previous Dept to move from department to department. Note the summary and formula items highlighted in yellow. No trigger code was required to calculate these values.
3 Modify the salary and commission of an employee. Note the total salary and departmental total salary are automatically updated.
4 Add or remove employees from a department. Note that the summary and formula items are automatically updated.
5 Click the Datasource tab.
6 Click Reconnect, and type connection information for the ODBC datasource you set up in Step 1. You should use the connection string odbc:demodbase. Note that after a successful connection, the information for the new datasource is displayed in the Datasource information text boxes.
7 Click the Calcform tab.
8 Repeat Steps 2-4. Notice that the same form runs against Oracle and ODBC.
Connecting to foreign datasources: Creating a dBASE ODBC datasource
To create a dBASE ODBC datasource:
1 Make sure you have installed the INTERSOLV ODBC Driver for dBASE provided with your Forms Developer installation CD. If not, rerun setup from the CD and install them.
2 Run the ODBC Administrator. You can usually find this icon in your Microsoft Windows Control Panel.
3 Click Add to add a new ODBC datasource.
4 Double-click INTERSOLV OEM 2.12 32-BIT dBASE File (*.dbf) to display the ODBC dBASE Driver Setup dialog box.
5 Type demodbase in the Data Source Name text box.
6 (Optional) Type a suitable description in the Description text box.
7 Type ORACLE_HOME\TOOLS\DEVDEM60\BIN in the Database Directory text box. For example, if your Oracle Home directory is C:\ORAWIN95, type C:\ORAWIN95\TOOLS\DEVDEM60\BIN.
8 Click OK.
9 In the ODBC Data Source Administrator, click OK.
Accessing Microsoft Access
<> Related Topics Open oca_info.pdf
To access Microsoft Access:
1 Set up your system to use the Open Client Adapter (OCA).
2 Read through the release notes and the PDF document (oca_info.pdf).
3 (Optional) Run the.SQL scripts to create and populate demo tables using the UBT utility:
UBT32.EXE user/password@ODBC:datasource[:dbname] @sqlscript Example
If dbname is not specified, the views will be created in the 'current' database for the ODBC connection.
4 Launch the Builder.
5 (Form Builder only) Set the Primary Key property for each data item to Yes. Data items correspond to columns in your datasource.
6 When you are ready to connect to the Microsoft Access datasource, type the following connect string in the Connect dialog box:
[user[/password]]@ODBC:datasource[:dbname] Example
For more information about accessing Microsoft Access, see oca_info.pdf.
About the Open Client Adapter (OCA)
Open oca_info.pdf
The Oracle Open Client Adapter (OCA) for ODBC allows applications on Microsoft Windows 3.1, Windows 95/98, and Windows NT to access ODBC-compliant datasources through ODBC drivers. The OCA requires the ODBC driver to be ODBC level 1-compliant. OCA also uses certain level 2 ODBC functionality to achieve greater performance if that capability is provided by the ODBC driver.
Using the OCA, an application can access different datasources in a consistent manner. This allows an application developer to build an application that can run unmodified against one of several datasources. Alternatively, the application can be targeted at a specific datasource, and take advantage of features particular to that system.
The OCA is installed through the Oracle Installer, which copies all necessary files to your ORACLE_HOME directory. One of these files is oca.pll, which is a PL/SQL library of functions that you can use from within applications to:
n Open auxiliary connections to other datasources in addition to the application's main connection.
n Execute arbitrary SQL statements and Stored Procedure calls on any connection.
n Retrieve results sets from non-Oracle stored procedures.
n Obtain the DBMS and ODBC driver names and versions for a given connection.
n Automatically adjust Form and Data Block properties at runtime to suit the datasource.
Click the button at the top of this topic to learn more about these functions.
For details about other installed files, refer to the release notes.
Partager