Using the MSHTML control, you can read data in HTML format into a recordset. Here’s an example, which I’ll call data.html. This document holds data in HTML format; the data we’re using here represents a set of employees. I’ve divided the data into records, one for each employee. Each record has several fields, such as Name to hold the employee’s name, ID to hold their ID number, and so on. You can create a record just by storing multiple fields, and you create a field by giving a <SPAN> element a name and then storing the data as that <SPAN> element’s text. Here’s what the data document looks like, with five employee records:
Code View:
Scroll
/
Show All <HTML> <HEAD> <TITLE> A Data Document </TITLE> </HEAD> <BODY> <H1> This page holds data. </H1> Name: <SPAN ID="NAME">Frank</SPAN><BR> ID: <SPAN ID="ID">2314</SPAN><BR> Hire Date: <SPAN ID="HIRE_DATE"> 9-2-2003</SPAN><BR> Department: <SPAN ID="DEPARTMENT"> Shipping</SPAN><BR> Title: <SPAN ID="TITLE">Packer</SPAN><BR> Name: <SPAN ID="NAME">Martin</SPAN><BR> ID: <SPAN ID="ID">2315</SPAN><BR> Hire Date: <SPAN ID="HIRE_DATE"> 9-2-2003</SPAN><BR> Department: <SPAN ID="DEPARTMENT"> Packing</SPAN><BR> Title: <SPAN ID="TITLE">Programmer</SPAN><BR> Name: <SPAN ID="NAME">Tom</SPAN><BR> ID: <SPAN ID="ID">2316</SPAN><BR> Hire Date: <SPAN ID="HIRE_DATE"> 9-2-2003</SPAN><BR> Department: <SPAN ID="DEPARTMENT"> Shipping</SPAN><BR> Title: <SPAN ID="TITLE">Packer</SPAN><BR> Name: <SPAN ID="NAME">Henry</SPAN><BR> ID: <SPAN ID="ID">2317</SPAN><BR> Hire Date: <SPAN ID="HIRE_DATE"> 9-2-2003</SPAN><BR> Department: <SPAN ID="DEPARTMENT"> Shipping</SPAN><BR> Title: <SPAN ID="TITLE">Packer</SPAN><BR> Name: <SPAN ID="NAME">Paula</SPAN><BR> ID: <SPAN ID="ID">2318</SPAN><BR> Hire Date: <SPAN ID="HIRE_DATE"> 9-2-2003</SPAN><BR> Department: <SPAN ID="DEPARTMENT"> Shipping</SPAN><BR> Title: <SPAN ID="TITLE">Packer</SPAN><BR> </BODY> </HTML> |