Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I read HTML files into Access

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
If I have something similar to the following, how do I read it into Access97 or Access2000 for processing? Do I just treat it like a text file and parse it myself or are there some functions which help with the process. The following would need to be read into a table as 1 record.

Thanks in advance for any help! Happy New Year!


<THEAD>
<TR>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>KeyID</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>PropID</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>FrmName</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>CtlName</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>CtlValue</FONT></TH>

</TR>
</THEAD>
 
SBendBuckeye,

I know nothing about html files.

I suppose you could make a table like:

HTMLFileName Text
HTMLFileDate Date/Time
HTMLDescription Text
HTMLContent Memo

Then:

1) Open a dialog box to get the specifics
2) Read File

HTMLContent = &quot;&quot;
Open me.strFileSpec For Input as #1
While Not EOF(1)
Line Input #1, buf
HTMLContent = HTMLContent & buf & vbCrLf
Wend

3) strSQL = &quot;Insert into ...&quot;
4) dbs.execute(strSQL)

Had to at least contribute something. It is tough to
look at the 0 response.

Happy New Year,
Wayne
 
Since every site is designed differently you'll have a lot of work on your hands. Parsing some sites or pages with a lot of frontpage gook would be impossible, or at least no worth the work; there's site maps and all kinds of stuff that's essentially useles to save. If you are doing sites, then there's the copyright stuff too, not that you didn't think about that.

Usually people generate html or JSP or ASP files from a db. So if you understand ASP or something then maybe that would be a reverse start. If you are parsing a specific site then you can just connect through the ISP. If you are looking for text content, the only thing I can think of is save the html file, save it as txt and parse out everything that has the <> brackets. But it would probably be easier to highlight all the text on a page, hit ctrl + c and paste it into a memo field.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top