dcsimg

Developing from Chaos Page 3

By ServerWatch Staff (Send Email)
Posted Mar 28, 1999


T.Mallard
Using ASP to Create a Website from Spreadsheets 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>")



Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.


 

 


Thanks for your registration, follow us on our social networks to keep up-to-date