Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving HTML pages from SQL output

Status
Not open for further replies.

rmpuk

Technical User
Nov 19, 2001
32
GB

Hi,

I need to generate a large number of HTML pages from an SQL database. I can easily generate the pages, but would ideally like some way to automate the proceedure - eg automatically save the HTML page output for each record.

For example, say we have a single input (number from 1 to 100). Dependant on this input, a different image is displayed. Is there a way to do this automatically, so that 100 pages are generated each displaying say 001.jpg, 002.jpg, etc. I know how to generate the pages with ASP, it's the (a) automatically entering each number to generate 100 pages, and (b) saving them I'm stumped by. Web search brought up nothing... ;(

Thanks in advance,

Richard
 
Sounds like you are looking for the fileSystemObject. .createTextFile() in particular. Although the name implies .txt, you can save a file of text (<html> is just a glorified .txt file) with any extension using it.


is the best little quick reference out there for all the properties and methods associated with the fileSystemObject. Basically, you'd need to read the contents on the entire file into a variable (which it appears you know how to do), and then use the .createTextFile method to make the .html file. You would then envoke the .write() method of the new object (the text file you create), passing it that variable holding the contents of what will be your file, and then save it.

If you run into any stumbling blocks, post back, and someone here can surely help you through it.

:)
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top