Database to Webpage - pointers needed

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a database (Access) which contains fields with descriptions and the
paths to pictures that go with them - I want to generate/create pages with
these descriptions and pictures on them (two columns - pictures in right
hand, descriptions in left hand) - I am sure this is possible and probably
complicated - can anyone just give me a few pointers on general methodology
and how to approach it - I am not asking someone to do the work just to set
me on the right path to finding out.


Re: Database to Webpage - pointers needed

Quoted text here. Click to load it

Ask in a ms access group.


Re: Database to Webpage - pointers needed

Quoted text here. Click to load it

As far as "complicated" goes:  if you've never done this before it can be
abit to learn at once...  if you have done this before this is one of the
easiest tasks you can do with a database

Basically, these are the steps you are going to need to do:

1. Open connection to the database
2. Open the database, specifying with SQL what data you want
3. Loop through the database until "End of File"
    a. Pull new record from database
    b. Write formatted data to buffer/output path
4. Close the database
5. Close connection to the database
6. Cleanup

Basically, the ASP will end up looking something like:

' Step 1:
Set MyDBConnection = Server.CreateObject("ADODB.Connection")
MyDBConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &

' Step 2:
Set dbRecordset = Server.CreateObject("ADODB.Recordset")
dbRecordset.Open "SELECT imagepath, imagetext FROM TableName",

' Step 3:
DO WHILE NOT dbRecordset.EOF

' Step 3a and 3b:  this outputs the picture with the text below it
response.write "<br><br><img src='"& dbRecordset("imagepath") &"'><br>" &

' Step 3: end the loop

' Step 4:

' Step 5:

' Step 6:
Set dbRecordset = nothing
Set MyDBConnection = nothing

And thats about it... the above example doesn't lay out the image/text the
way you want it... just puts it out as a picture with the text below it.

You can find a decent tutorial on working with access databases at:

Re: Database to Webpage - pointers needed

On 22 Oct 2004 15:06:54 GMT, Ken Frost

Quoted text here. Click to load it

I'd suggest a solution that's off-line content management, rather than
a dynamic backend to a web server. This is for three reasons:

 - I guess you're making changes fairly infrequently.

 - Access isn't a good database backend for a 24/7 web server.

 - Hosting for the Windows platform is less conveniently available
than Unix, and for bare-bones no-scripting hosting.

So, take your Access DB and write some VBA code to generate HTML from
the database. Start out by writing a couple of static HTML pages; one
that's a "thumbnail gallery", another that's a single image view
(maybe click-throughs to diferent sizes, thumbnails of the adjacent
images etc.).   Cut-and-paste this HTML into your VB code, inserting
the database fields in the appropriate places.  Add loops over the
images through a RecordSet, and some code for file management to make
a new directory under \temp\ and write the new pages into it.

Test your code. It ought to work locally  (make sure the image paths
are correct, and full absolute URLs are probably easiest to work

Connect up an Access form with a big button on it labelled "Export".
If you can find an ftp ActiveX control, make another one for "Upload".

That's about it. The rest is in "Learn Geekery in 24 hours", or post
again with any specific questions.

An alternative way (how I do it) is to generate an XML document from
VBA, then use an XSLT transform on this to make the HTML.  This has
advantages for some non-programmer users, because you can build the
Access code yourself and let someone who knows a little HTML modify
the XSLT afterwards, so as to permit later changes to the site's
appearance.   I use RSS 1.0 and Dublin Core as a suitable XML Schema
for the intermediate step.

Smert' spamionam

Re: Database to Webpage - pointers needed

Quoted text here. Click to load it
Thank you Augustus and Andy - both really helpful replies I am going to
have a go and see where I get to.


Quoted text here. Click to load it

Site Timeline