save an HTML report...

J

Jim Rudnick

I am generating a report in HTML, that my users can look over AND if
they want to, store in their own Access dbase.

Thing is, I do not know how to "read" that whole html page into a var
and store same in a field in Access.

Can anyone point me here?

Jim
 
A

Alan Howard

Buffer the HTML to a string first. You can then preview the page (in a new
window or wherever) using Response.Write strPageHtml and/or store the HTML
in the database in a normal char, varchar, text field.

Alan
 
J

Jim Rudnick

Hmmm...exactly what does "buffer the string" in this context mean?

The html report is the result of a query on another text file and it
will be pretty plain, but will have a table in it for sure.

So, how do I "buffer" same? I know how to write a string to a dbase,
just not how to read an onscreen .html page into that string???

;-)

Jim
 
A

Alan Howard

Instead of just Response.Write'ing your content out, set up a local variable
and write the various bits 'n' pieces to it:

Dim strPageHtml

' Buffer the HTML to a local variable, strPageHtml
strPageHtml = ""
strPageHtml = strPageHtml & "<html>"
strPageHtml = strPageHtml & "<head>"
....
strPageHtml = strPageHtml & "</body>"
strPageHtml = strPageHtml & "</html>"
....

' Output the HTML - this will display the content on-screen.
Response.Write strPageHtml

I'm not suggesting that you'll be able to do this without reorganising your
code though. You might display the HTML content onscreen along with, say, a
small form at the bottom of the page. The form contains a hidden control
whose value is the strPageHtml variable you created when buffering the page.
The form is submitted when the user elects to save the report to the
database, and when this happens you post the value of the variable (the page
HTML) to the processor where it can be written to the database.

Alan
 
A

Alan Howard

By the way Jim, you should mangle your email address (assuming it's real) to
stop spambots picking it up in these newsgroups.

Alan
 

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

Members online

No members online now.

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,382
Latest member
MichaleStr

Latest Threads

Top