Column/Field names when Importing HTML

G

Guest

I am experimenting with importing HTML files containing mutiple tables.

So far I have been able to select the right HTML Table and import some data.
However I can only import HTML data into an access table whose field names
are "F1", "F2", "F3"...

I know HTML is rather row-orientated, but is there any way to define HTML
import table so it will map data into a table with meaningful column names?
 
J

John Nurick

It sounds as if the HTML column headings are in <td></td> elements. Use
<th></th> instead and Jet should accept these as field names.
 
G

Guest

I'm sure you're right John, thanks. A couple of things threw me off.

Some column-oriented arrangements don't naturally have headings, think of
mail headers:-

Subject: xxxxxxxxxx
Date: xxxxxxxxx

It was data in this form I was using to test. I suppose in the case where
you control your owm HTML format you could try to create invisible column
headers, or just live with the "F1" style names in import tables and then
transfer the data into the real tables separately.

Secondly, I'm pretty sure the Import Wizard created column names of the form
"Field 1", "Field "..., whereas scripted importing used "F1", "F2"... However
I may be mis-remembering the sequence of events here.

I have found that importing HTML into a new table tends to fail on things
like dates. Access recognises a column as a date, sets the field type, then
fails on a a data format error when it trys to import the actual value.
Oddly, reading the HTML value into a field of type text in an existing table,
then converting this to the date type DOES work, which is odd.

Thanks for your help.
 
J

John Nurick

Access's HTML import routine is designed only for importing the contents
of simple tables and expects them to use <th> for column headings and
<td> for cells containing data.

Unfortunately, a lot of web pages use <table>...</table> as a general
purpose layout mechanism, and Access doesn't always make sense of these.
You may do better to write code yourself to parse the HTML and pick out
the bits you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top