Question How to import a html with tables and images with vba

herbertioz

Registered User.
Local time
Today, 22:27
Joined
Nov 6, 2009
Messages
66
I want to import a html file with tables and images into my database.
Then I want to copy some of the tables and images into a report. Do someone have some suggestions?:)

I can use docmd.transfertext maybe, but what about the images?

How can I structure the html file in the tables?
 
As a general rule you do not import images into Acces table, you import the full path and file name to the image into a field in a table and use this as a reference when opening or viewing the image.
 
Yes, thats ok. But do you have some suggestions to do that?

As a general rule you do not import images into Acces table, you import the full path and file name to the image into a field in a table and use this as a reference when opening or viewing the image.
 
What version of Access are you using? and what does the html file look like?
 
I am using access 2007. An example html file under:

Code:
<HTML>
<img src="picture1.png" alt="Picture1">
<img src="picture2.png" alt="Picture2">
<table border=1>
<tbody>
<tr>
<th>Title</th>
<th>Director</th>
</tr>
<tr>
<td>Excalibur</td>
<td>Boorman</td>
</tr>
<tr>
<td>Star Wars</td>
<td>Lucas</td>
</tr>
</tbody>
</table>
</HTML>

What version of Access are you using? and what does the html file look like?
 
A 2007 has option to import html files, have you tried that option yet?
 
if you use the wizard to create the savedimport then save it as a spec, you can then use vba to run the savedimport spec

docmd.RunSavedImportExport "YourNamHere"
 
Ok, but is it possible with docmd.transfertext and code the whole thing? And what about the url to the image?

if you use the wizard to create the savedimport then save it as a spec, you can then use vba to run the savedimport spec

docmd.RunSavedImportExport "YourNamHere"
 
To do it the way you want you may have to go the long way round and read each line 1 at a time and parse out the data and structure. Is there a reason why you can't use the prefered method.
 
Ok, thanks for help! I think I have to do this the hard way, we will see.

To do it the way you want you may have to go the long way round and read each line 1 at a time and parse out the data and structure. Is there a reason why you can't use the prefered method.
 

Users who are viewing this thread

Back
Top Bottom