Professional Documents
Culture Documents
Access To HTMLDB
Access To HTMLDB
Executive Overview.............................................................................. 4
Introduction........................................................................................... 4
Steps to Migrate a Microsoft Access Application to Oracle HTML DB5
Understanding the Core Functionality and Purpose of the Microsoft
Access Application ........................................................................... 6
Understanding the Data Model of the Microsoft Access Application6
Understanding How AutoNumber is Implemented in the Oracle
Database............................................................................................ 7
Understanding the User Interface of the Microsoft Access
Application........................................................................................ 7
Translate the Microsoft Access UI to a Web UI............................... 8
Export/Import the Data ..................................................................... 9
Maintaining the Table Relationships .............................................. 11
Building the User Interface with Oracle HTML DB ...................... 12
Case Study: Migrating the Microsoft Access Contact Management
Application to an Oracle HTML DB Web Application...................... 17
Understanding the Functionality and Purpose of the Contact
Management Application................................................................ 18
Understanding the Data Model of the Contact Management
Application...................................................................................... 18
Understanding How AutoNumber Columns Translate to the Oracle
HTML DB Application................................................................... 20
Understanding the User Interface of the Contact Management
Application...................................................................................... 21
Translating the Contact Management User Interface to a Web
Application Interface ...................................................................... 21
Export the Data from the Contact Management Application and
Import into Oracle HTML DB........................................................ 21
Maintaining the Table Relationships .............................................. 23
Build the Contact Management Web Application Using Oracle
HTML DB....................................................................................... 24
Apply User Interface Defaults to the Contact Management Tables24
Create the Application Shell ....................................................... 25
Create the Reports and Forms..................................................... 25
EXECUTIVE OVERVIEW
Many organizations manage information using desktop databases or
spreadsheets. This model of information sharing is inefficient and costly to
maintain. With duplicate copies of data stored on personal computers or laptops,
the inevitable fragmentation makes guaranteeing the accuracy, timeliness and
security of information next to impossible.
Microsoft Access was designed as a personal database for a single person to
manipulate data from a Microsoft Windows machine that has Microsoft Access
installed. While it is often easy to build Microsoft Access applications, it is
difficult to deploy that application to many users for concurrent access.
Building a Web-based application that supports a multi-user environment is a
more efficient way to manage this type of information. All users who need
access to the information could be provided with the URL to access the
application.
This paper describes how Microsoft Access UI (user interface) and database
concepts map to the Oracle HTML DB and Oracle database equivalents. It
includes a case study in which an actual Microsoft Access database application
is converted to Oracle HTML DB and the Oracle database. Finally, this paper
describes how Oracle HTML DB can be used to improve the original Microsoft
Access application by providing access control to users with different roles.
INTRODUCTION
Oracle HTML DB allows programmers and non-programmers to convert
spreadsheets and desktop databases into robust, secure, scalable Web
applications that support multiple users concurrently. This paper focuses on
converting a Microsoft Access desktop database application, to a Web-based
Oracle HTML DB application.
Users that are familiar with using Microsoft Access to build applications should
be able to build applications using Oracle HTML DB. The basic difference is
that you use a client/server development environment to build client/server
applications with Microsoft Access, and you use a browser development
environment to build Web applications with Oracle HTML DB. Most Microsoft
Next, you need to understand how and if the tables relate to each other. For this,
Microsoft Access provides a data model view of your tables. To see the data
model, go to Tools > Relationships. You will be presented with a graphical
representation of the tables. If you see lines between tables, it means those
tables relate. If you right click on the line, and choose Edit Relationship you
will see details about how the tables relate. Write down the tables and columns
involved in the relationship.
To create a select list, you first create a shared list of values (LOV).
To view how the three tables relate to each other, you can use the data model
view. The data model view represents the tables and their relationships
graphically. To see this view, go to Tools > Relationships. The figure below is
the data model view of the Contact Management application.
You can see from this view that the Contacts table contains a column called
ContactTypeID, which has a line drawn to the Contact Types table, primary key
column ContactTypeID. This demonstrates that Contacts is a child of Contact
Types. You can also see that there is a line drawn from the Calls table, the
column ContactID to the primary key column of the same name to the Contacts
table. This indicates that Calls is a child of the Contacts table. As a visual
indicator, the primary key column of each table is bold.
Export the Data from the Contact Management Application and Import
into Oracle HTML DB
First, export the data from each table in a comma separated file. The first row of
each file should include the column headings.
To export the Calls table from the Contact Management application:
1. From the object browser click on Tables.
2. Right click on the Calls table and choose Export.
3. Leave the filename as Calls and choose Text Files as the save as type, click
Save.
4. Choose Delimited as the export type and click Next.
5. Choose Comma as the delimiter and double quote (“) as the Text
Qualifier.
The first step is to apply the UI defaults to the tables you imported. You will
provide label defaults for all columns of all three tables, and you will apply a
format mask for the two DATE columns in the CALLS table.
To apply UI defaults to the CALLS table:
1. Click the SQL navigation bar icon.
2. Click Tables under Data Browser.
3. Locate the CALLS table and click the view icon next to it.
4. Select Manage UI Defaults from the Tasks list.
5. Changed the labels to friendly names, for example change the
CONTACTID column label to Contact and CALLDATE to Call Date.
6. Enter MM/DD/YYYY in the Mask field for both forms and reports for the
CALLDATE column.
7. Enter HH24:MI:SS in the Mask field for both forms and reports for the
CALLTIME column.
8. Click Apply Changes.
9. Click Cancel.
10. Click the edit icon next to the CALLDATE column.
11. Under Default for Forms, choose Date Picker (MM/DD/YYYY) from the
Display As list. This will allow the user to choose the date from a pop-up
calendar.
12. Click Apply Changes.
13. Click the edit icon next to the NOTES column.
14. Under Default for Forms, choose Textarea from the Display As list, enter
50 for the width, and enter 5 for the height. The textarea display type
allows for easier entry of larger amounts of text.
15. Click Apply Changes.
Repeat these steps to change the labels for columns in the CONTACTS table
and CONTACT_TYPES table.
You use the Create Application Wizard to create the Web application from
scratch.
To create a new application:
1. Click on the Build navigation bar icon.
2. When the Application Builder appears, click Create Application.
3. In the Create Application Wizard:
a. Create a new application from scratch.
b. Enter Contact Management for the name.
c. In Pages, select 3.
d. Under Tabs, select One Level of Tabs.
e. When naming the pages, enter Contacts for page one, Calls
for page two, and Contact Types for page three.
f. Accept the same as above for tab names.
g. Choose Simple Blue and Tan for a theme.
h. Click Create Application.
If you run your new application, note that you have three pages linked together
by tabs, or the basic shell for your application. It should look similar to the
figure below.
After your application shell is created, the next step is to it. For each table, you
will create a form and a report. The report will link to the form to allow you to
update or delete existing entries as well as add new entries.
You create the forms and reports by running the Report with Links to Form on a
Table Wizard.
To create a form with links to a form on the Contacts table:
Click on one of the edit icons and you should see something similar to the
following figure.
Create LOVs on the Parent Tables and Associate them in Reports and Forms
Notice that the Contact Type column in both the report and form shows the
unique identifier relating to the CONTACT_TYPES table. The same is true for
the Contact column on the Calls report and form. Instead of showing the unique
identifier, it is better to show the display value from the parent table. You
accomplish this by creating Lists of Values (LOVs) and associating them.
To create an LOV based on the parent table CONTACT_TYPES:
1. Click the Build navigation bar icon.
2. Choose the application you created and click Go.
3. Click the LOVs tab.
4. Click Create >.
5. In the Create LOV wizard:
a. Choose to create the LOV From Scratch.
b. Enter CONTACT_TYPES_LOV for the name.
c. Choose Dynamic as the type.
d. Enter the following as the Query:
select contacttype d, contacttypeid r
from contact_types
e. Click Create Named LOV.
To create an LOV based on the parent table CONTACTS:
1. Click the Build navigation bar icon.
2. Choose the application you created and click Go.
3. Click the LOVs tab.
4. Click Create >.
5. In the Create LOV wizard:
a. Choose to create the LOV From Scratch.
Clicking on one of the entries displays a form, with the contact listed in a select
list. The form should looks similar to the following figure.
Eventually, you will create a link from a contact in the Contacts report to the
Calls page listing only calls made to that contact. To accomplish this, you first
create an item from which the user can choose a contact on the Calls report
page. Next to the item, you place a Go button to submit the page. Finally, you
alter the query for the Calls report region, to constrain the query by the contact,
if one was selected.
To add a select list on the Calls report page to choose a contact:
1. Click the Build navigation bar icon.
2. Choose the application you created and click Go.
3. Click the Calls page in the page list, or enter 2 in the Edit Page field and
click Go.
4. Under Items, click Create.
5. In the Create Item Wizard:
a. Name the item P2_CONTACTID.
b. Choose Select List from the Display As list.
c. Choose CONTACTS_LOV as the named LOV.
d. Enter – All Contacts – as the null text.
e. Enter 0 as the null value.
f. Enter Contact for the label.
g. Click Create Item.
To add a Go button on the Calls report page:
1. Under Buttons, click Create.
2. In the Create Button Wizard:
a. Choose Create a button displayed among this region’s items as
the task.
b. Enter P2_GO as the button name.
c. Uncheck Beginning on New Field option.
d. Click Create Button.
To constrain the Calls report region query by the P2_CONTACTID item:
1. Under Regions, click Calls.
2. Change the region source to:
When you click the Create Call link, you are taken to the Call form page, with
the corresponding contact already chosen. It would be nice if the date and time
defaulted to the current date and time.
Add Validations for the Call Date and Call Time Fields
It is possible that the user could enter an invalid date or time format in the Call
Date or Call Time fields. If they do, when they click Create or Apply Changes
(if editing), they will be taken to an error page displaying a general database
error message.
CONCLUSION
Desktop databases and spreadsheets are an inefficient and poor way to manage
information. A more efficient, scalable, and secure approach to managing
information is to use an Oracle database with a Web application as the user
interface.
This document has demonstrated how you can use Oracle HTML DB to convert
a Microsoft Access application into a Web application that can be used by
multiple users concurrently. It also demonstrated how you could use Oracle
HTML DB to improve the original application by adding hit highlighting and an
authorization scheme to provide access control to different types of users.
This application can be accessed using a Web browser and does not require the
user to install additional software.
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
www.oracle.com