ASP 101 - Active Server Pages 101
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates

ASP 101 is an site
ASP 101 is an site
Internet Lists
Internet News
Internet Resources
Linux/Open Source
Personal Technology
Small Business
Windows Technology
xSP Resources
Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash
your e-mail address:

 Top ASP 101 Stories Top ASP 101 Stories
VBScript Classes: Part 1 of N
Migrating to ASP.NET
Getting Scripts to Run on a Schedule

Use the front door, please!
Show All Tips >>

Developing from Chaos

The next-previous values are done, this took a few tries but not much time to develop. Next step is to open the recordsets needed to make the first part of the html now that the filename is ready.

set cmd1 = server.createobject("ADODB.Command")
cmd1.ActiveConnection = conn1
cmd1.CommandText = "update product set prod_page = '" & filename & "' where product.part_number = '" & rsInput("part_number") & "'"
set rsOutput = cmd1.execute
response.write("updated: " & rsInput("part_number") & "<br>")
set cmd1.ActiveConnection = nothing
set cmd1 = nothing
set conn2 = server.createobject("Scripting.FileSystemObject")
set output = conn2.OpenTextFile(htmlOut, 8, True)

The html page is now open with the new filename and ready to use the Access table for source data to build the page within the html template. The outside while loop creates pages for the entire catalog; after this the package is ready for a few more additions. Note that the "8" is used here, I had trouble with ForAppending due to an old version of Access (95 v7) and use the numbers for these settings. So here is a hunk of html with a few insertions throughout of database material. Work flow is to finish the head area first, then navigation, add the content, the footer and save the page.

output.writeline("<!-- DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 3.2 Final//EN""-->")
output.writeline("<title>PairGain from Government Network Solutions - " & rsInput("prod_type") & "</title>")
output.writeline("<meta name=""Publisher"" content=""Government Network Solutions"">")
output.writeline("<meta name=""Publisher-email"" content="""">")
output.writeline("<meta name=""Key"" content=""" & rsInput("part_number") & """>")
output.writeline("<meta name=""Description"" content="""">")
output.writeline("<meta name=""Identifier-URL"" content="""">")
output.writeline("<meta name=""Content-Language"" content=""en-US"">")
output.writeline("<meta name=""Coverage"" content=""Worldwide"">")
output.writeline("<meta name=""Date-created-yyyymmdd"" content=""19990416"">")
output.writeline("<meta name=""Date-Revised-yyyymmdd"" content=""*"">")
output.writeline("<body bgcolor=ffffff link=0000ff vlink=8e2323 alink=00009c>")
output.writeline("<basefont face='verdana,arial,helvetica' size=2 color=000000>
output.writeline("<a name=""page_top""> </a>")
output.writeline("<table border=1 cellspacing=6 cellpadding=6 bordercolor=000080 align=left>")
output.writeline("<tr><td bgcolor=0066cc><b><font size=3 color=ffffff>G</font><font size=2 color=99ccff>OVERNMENT</font> <font size=3 color=ffffff>N</font><font size=2 color=99ccff>ETWORK</font> <font size=3 color=ffffff>S</font><font size=2 color=99ccff>OLUTIONS</font></b></td></tr>")
output.writeline("<tr><td bgcolor=ffffff background=""../jpgs/aback_05.jpg""><center><img src=""gifs/pairgain_logo_07.gif"" width=148 height=51 hspace=4 vspace=4 border=0 alt=""PairGain Products.""></center></td></tr>")
output.writeline("<p align=right><a href=""order.html"">How to Order or Get More Information</a></p>")
output.writeline("<p align=right><a href=""gsa_price.html"">GSA Price List</a></p>")
output.writeline("<p align=right><a href=""index.html"">Return to Home Page</a> <hr></p>")
output.writeline("<font size=4 color=800000 face=""Arial,Helvetica,Verdana"">" & rsInput("prod_type") & "</font><br>")
output.writeline("<font size=4 color=000000 face=""Arial,Helvetica,Verdana"">" & rsInput("prod_group_title") & "</font><br>")
output.writeline("<font size=2 color=000000 face=""Arial,Helvetica,Verdana"">" & rsInput("description") & "</font><br>")
output.writeline("<font size=4 color=000000 face=""Arial,Helvetica,Verdana"">" & rsInput("prod_title") & "</font><br>")

Now that has the navigation in, time to open some more recordsets...getting pricing and product content, and of course the notes. The connection strings use "2" for a dynamic cursor, "3" is next for optimistic locking and "2" represents a table as a source of data. The final wend and end if relate to the series variable and page naming loop above.



Previous versions of VBScript are CaseSensitive, this is written for the latest version.
Development Test System: Windows98, PentiumII 200MHz 128Mb
Personal Web Server 4.0 (IIS4), SQL7b3, Personal Oracle, Sybase

Author: T.Mallard, Seattle, WA
Copyright 1999 Thomas Mallard, USA


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

JupiterWeb networks:

Search JupiterWeb:

Jupitermedia Corporation has two divisions: Jupiterimages andJupiterWeb

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers