Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Problem importing html into Access

Problem importing html into Access

Problem importing html into Access

I'm an experienced Access/VBA developer and am having trouble with importing some html data files into Access.
I've tried:
1. Toolbar wizard, External Data, html Document - gives 2 errors, first says it can't file the html file, second says the file may be in the wrong format.
2. DoCmd.TransferText acImportHTML, ... - this gives an error 3011, file not found
Set con = CreateObject("ADODB.Connection")
con.Open _
"Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=C:\...(folders)...\trades.html;" & _
"Extended Properties=""HTML Import;HDR=YES;IMEX=1"";"
None of these 3 work. All give errors.
The html file will open in a browser window (IE, Chrome) and looks fine.
There is something about this html file that Access doesn't like but I don't know what it is.
I can open Excel, click File, Open, set the filter to 'All Web Pages' and successfully open it there.
I've tried Googling for known problems with Access importing html but haven't found anything.
I wonder if any of the developers here have had similar issues. I'm attaching the problem html file.

RE: Problem importing html into Access

The problem is that Access is falry limited on the HTML it will import as a table. Basically it needs to be able to recognise it as a single, simple table. Which your HTML is not. Get rid of the first table defined in the file, and the file then loads fine.

RE: Problem importing html into Access

Hey strongm,

That was an excellent suggestion, thanks!
I removed the first table and the import wizard now works fine. It's great to have a workaround.
Attached is another file in the same format, also with 2 tables that has no problem importing with the wizard. I do have to tell the wizard that its the 2nd table I want, but that's ok. With the original file I attached, the wizard errors out before I have a chance to say its the 2nd file I want.
I guess it doesn't matter now, but I am curious why the first trades.html file causes a problem, but not the second trades.html ...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close