Home

Microsoft Access and HTML

 

Importing an HTML File

If you have a table on a web page and the table is well structured for a database, you can use it as a table of your database. That is, you can import it in Microsoft Access. Like a normal text file, a typical HTML document can contain anything. This means that you should not attempt to import just any HTML file into your database. When in doubt, you should first check it. A good candidate to be imported should have all the necessary tags of an HTML table: table, tr (for the records), and td (for the columns). As long as the table is well created inside of the document, Microsoft Access can identify, analyze, and decide whether it is ready to be imported.

To import an HTML file in Microsoft Access, on the Ribbon, click External Data and, in the Import section, click the More button and click HTML Document. The steps to follow are the same for a text document.

A Microsoft Access Table on a Web Page

You can transfer a Microsoft Access table and its data to a web page and you have many options. If you are using an application such as Microsoft FrontPage or Microsoft Expression Web, you can copy and paste. To do this:

  • If you want to copy all columns and all records, in the Navigation Pane of Microsoft Access, right-click the table and click Copy. In the web page of the application (such as Microsoft FrontPage or Microsoft Expression Web), right-click the section you want on the web page and click Paste. Here is an example:

    Employees
    Employees
    Employee ID First Name Last Name Title HourlySalary
    1 John Simson Regional Manager $42.75
    2 Darius Sandt Sales Representative $18.60
    3 Ernestine Krazucki Public Relations Manager $28.15
    4 Paul Motto Sales Representative $16.45

  • If you want to copy all columns and all records, open the table in Microsoft Access, press Ctrl + A to select everything. Press Ctrl + C to copy. In the web page of the application, click the section you want on the web page and press Ctrl + V to paste 
  • If you want to copy only some columns and/or some records, open the table in Microsoft Access. Make the selection. Right-click the selection and click Copy. In the web application, right-click the section you want on the web page and click Paste or click the section and press Ctrl +V 

Some other applications do not support copy and paste. An alternative is to export the table to HTML. To save a table as HTML, in the Navigation Pane:

  • Right-click the table that holds the data, position the mouse on Export, and click HTML Document
  • Click the table you want to export. On the Ribbon, click External Data and, in the Export section, click More -> HTML Document

This would open the Export - HTML Document dialog box indicating the folder where the file will be saved, followed by the name of the file itself and its .html extension. Eventually, when the file has been saved, it would be complete with all the normal HTML tags. If you want the file to directly be part of a web site or a web project, you can change the path to point to your web folder. If you are only interested in the table, let the file be saved. Then, open the code of the document, which you can do with any text editor such as Notepad, copy only the code of the table and paste it in the desired section of your actual web page.

A Microsoft Access Database on the Web

Microsoft Access does not provide its own native means of connecting a database to the Internet, but it can be used as a server database accessed from the web. To make this happen, you can do everything manually or you would use an external application such as Microsoft Visual Studio, CodeGear Delphi.NET, Microsoft Expression Web, or many other applications. You can create an ASP application, a PHP web site, an ASP.NET project, etc.


Home Copyright © 2008-2012 FunctionX