Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    7

    Unanswered: Create & use html template file

    I want to output query results to html for posting to website. I'd like to be able to use a template file so I can include logo images, etc. but so far haven't figured it out (html file is created but it seems the template file is totally disregarded). I've checked online help but it wasn't much. Can someone point me in the right direction? Access 2000, Win 2k

    Thanks,
    OM Gang

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    A's template is extremely limited!

    my opinion: if you want it look anything like a reasonable page, your only option is to hand-code it.

    strHTML = "<!DOCTYPE HTML PUBLIC '"-//W3C//DTD HTML 4.01 Transitional//EN"'>" & vbcrlf
    strHTML = strHTML & "<html>" & vbcrlf
    strHTML = strHTML & "<head>" & vbcrlf
    strHTML = strHTML & "<title>My Super Page Title</title>" & vbcrlf
    strHTML = strHTML & "</head>" & vbcrlf
    strHTML = strHTML & "<body>" & vbcrlf
    strHTML = strHTML & "<img src='"super.gif"' width='"100%"' height='"10"'><br>" & vbcrlf
    etc...
    and write the string to super.htm

    you can take some of the sweat out of it by designing a page in a web editor using place-holders for the fields and adding the extra VB verbiage after.

    ...scope here for a neat little utility?

    izy

  3. #3
    Join Date
    Sep 2003
    Posts
    7
    Thany you. Not terribly experienced with html yet so let me see if I understand correctly:

    Write VBA procedure as you describe; write the string to an html file.

    Where you have the <body> tag, am I supposed to replace that with the db object I want to display as the body of the html page (ie. table, query, etc.)?

    Also, I'm not following you on the "...using place-holders for the fields and adding the extra VB verbiage after" (As I said I'm relatively new to web page/html stuff).

    Thanks again,
    OM Gang

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    this is not the right forum for html 101, but at its most primitive, web page source looks like:

    <html>
    <head>
    </head>
    <body>
    hello world<br>
    hello <b>again</b>
    </body>
    </html>

    type that in notepad and save it as hello.htm - you have a working html page.

    get access to create the whole text file using a string value from the db in place of "hello" and save as .htm - you have a working html report.

    to get your report to look good, you need a few more html tags.

    right-click/view-source on any web page. ignore the fancy stuff and concentrate on how the <img> <font></font> <table></table> <tr></tr> and <td></td> tags work ...after a few examples you will soon crack it. try to look at the least impressive web pages - the fancy pages are using language extensions, scripts and other exotica which only confuse the situation -they are not necessary for your html report.

    chami provides an excellent (and free) strictly-manual html editor, it's a great way to learn html. you will know enough html to make excellent access reports once you learn how to handle the tags mentioned above ...a few hours playing should do it.

    izy

  5. #5
    Join Date
    Sep 2003
    Posts
    7
    Thanks again. I have already experimented in Access with the example you first provided. First and last line would not complie due to quotation mark issues. Commenting out those lines allowed me to see string value in viewer (Debug.Print). I understand how html works and do use it (definitely not expert though). I was/am confused about the actual coding in Access. I see how assigning a value to a string variable allows me to create the necessary output, including html tags, but am not seeing how to include the query dynaset as part of that string value. I'll keep experimenting. You've got me pointed in the right direction.

    OM Gang

    Originally posted by izyrider
    this is not the right forum for html 101, but at its most primitive, web page source looks like:

    <html>
    <head>
    </head>
    <body>
    hello world<br>
    hello <b>again</b>
    </body>
    </html>

    type that in notepad and save it as hello.htm - you have a working html page.

    get access to create the whole text file using a string value from the db in place of "hello" and save as .htm - you have a working html report.

    to get your report to look good, you need a few more html tags.

    right-click/view-source on any web page. ignore the fancy stuff and concentrate on how the <img> <font></font> <table></table> <tr></tr> and <td></td> tags work ...after a few examples you will soon crack it. try to look at the least impressive web pages - the fancy pages are using language extensions, scripts and other exotica which only confuse the situation -they are not necessary for your html report.

    chami provides an excellent (and free) strictly-manual html editor, it's a great way to learn html. you will know enough html to make excellent access reports once you learn how to handle the tags mentioned above ...a few hours playing should do it.

    izy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •