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

Please visit our partners

Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
Developer
International
Internet Lists
Internet News
Internet Resources
IT
Linux/Open Source
Personal Technology
Small Business
Windows Technology
xSP Resources
Search internet.com
Advertise
Corporate Info
Newsletters
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

QUICK TIP:
Changing the default scripting language at the server level
Show All Tips >>


Developing from Chaos
Continued

while not rsInput.EOF
  if isnull(rsInput("note1")) then
lines = lines+1
rsInput.moveprevious
addin1 = rsInput("note1")
addin2 = rsInput("note2")
addin3 = rsInput("note3")
rsInput.movenext
rsInput("note1") = addin1
rsInput("note2") = addin2
rsInput("note3") = addin3
rsInput.update
response.write("."& vbCrLf)
  end if
  rsInput.movenext
  response.write(":" & "<br>"& vbCrLf)
wend
conn1.close
set rsInput = nothing
response.write("done: " & lines & vbCrLf)
%>

Next step is the basic product page, which has auto-numbering and link navigation created as a part of the build process. This first section of code just arranges the auto-numbering for this. The next opens a new output file, then opens the tables needed to produce a page between chunks of html. The finished page here is a first pass of many passes before all the keywords are inserted and the page is ready to publish. The database is within the web server's scope so has read/execute/script permissions set under IIS4, and the folder is shared for protection using the machine account under win98/NT4.

set rsInput = server.createobject("ADODB.Recordset")
rsInput.open "content", conn1, 2, 3, 2
rsInput.movefirst
lines = 1
while not rsInput.EOF
if not isnull(rsInput("prod_model")) then
series = series + 1
lines = lines + 1
 if series < 100 then
  if series < 10 then
   htmlOut = "x:\webshare\wwwroot\gns\v1\prod_00" & series & ".html"
   sNext = series + 1
   htmlNext = "prod_00" & sNext & ".html"
   if series > 1 then
    sPrev = series - 1
    htmlPrev = "prod_00" & sPrev & ".html"
  end if
 else
   htmlOut = "x:\webshare\wwwroot\gns\v1\prod_0" & series & ".html"
   sNext = series + 1
   htmlNext = "prod_0" & sNext & ".html"
   sPrev = series - 1
   if sPrev = 9 then
    htmlPrev = "prod_009.html"
  else
   htmlPrev = "prod_0" & sPrev & ".html"
   end if
  end if
 else
  htmlOut = "x:\webshare\wwwroot\gns\v1\prod_" & series & ".html"
  sNext = series + 1
  htmlNext = "prod_" & sNext & ".html"
  if series = 1 then
   htmlPrev = "prod_001.html"
  else
   sPrev = series - 1
  if sPrev = 99 then
   htmlPrev = "prod_099.html"
  else
   htmlPrev = "prod_" & sPrev & ".html"
  end if
 end if
end if
filename = mid(htmlOut, instr(htmlOut, "prod_"))
response.write("filename: " & filename & "<br>")

NEXT   PREVIOUS   

Stuff

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
http://www.mallard-design.com/
Copyright 1999 Thomas Mallard, USA

 


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


JupiterWeb networks:

internet.comearthweb.comDevx.com graphics.com

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