Importing Information from an HTML File

Importing Information from an HTML File

You might be familiar with the Hypertext Markup Language (HTML), which is used to create Web pages. HTML uses tags to control the appearance and alignment of text when it is displayed in a Web browser. To display a table on a Web page, the table’s elements—rows and cells—are enclosed in appropriate HTML tags. For example, a simple HTML table might look like this:

.
.
.
<table>
<tr>
   <td>LastName</td><td>FirstName</td>
</tr>
   <td>Anderson</td><td>Amy</td>
</tr>
</table>
.
.
.

Of course, a lot of other tags and text would appear above and below this little table, and few tables are this simple. But you can get the general idea. With an HTML document, it is the <table>, <tr> (table row), and <td> (table data) tags that make the data look like a table when viewed in a Web browser.

All Office 2003 programs can save a document in HTML format, and to a limited extent, they can read or import a document that was saved in HTML format by another program. If you attempt to import an HTML document into Access, it will parse the document and identify anything that looks like structured data. You can then look at what Access has found and decide whether to import it.

Important

If you want to import data into an existing table but the structure of the data isn’t the same as the table structure, it is often easier to import the data into Excel, manipulate it there, and then import it into Access.

In this exercise, you will import new customer information that is stored in an HTML document into the Customers table in the GardenCo database.

USE the GardenCo database and the NewCust HTML file in the practice file folder for this topic. These practice files are located in the My DocumentsMicrosoft PressAccess 2003 SBSImportingImportHTML folder and can also be accessed by clicking Start/All Programs/Microsoft Press/Access 2003 Step by Step.

OPEN the GardenCo database and acknowledge the safety warning, if necessary.

  1. Open the Customers table, and notice that it contains 107 records. Close the table.

  2. On the File menu, point to Get External Data, and then click Import.

  3. In the Files of type list, click HTML Documents.

  4. Navigate to the My DocumentsMicrosoft PressAccess 2003 SBSImportingImportHTML folder, click NewCust, and then click Import to display the first page of the Import HTML Wizard.

    Important

    The wizard displays the contents of the NewCust file, divided into rows and columns. If a file contains multiple tables or lists, the wizard lists them here, and you can select the one you want to import.

  5. Click Next to display the next page of the wizard.

  6. Select the In an Existing Table option, click Customers in the drop-down list, and then click Next.

  7. Click Finish to import the new customers into the Customers table.

  8. In the message box that appears, click OK to close it, and then open the Customers table.

    The table now contains 110 records.

  9. Close the Customers table.

CLOSE the GardenCo database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset