dcsimg

ASP Developing for Academic and Business Processes Page 8

By ServerWatch Staff (Send Email)
Posted Jan 25, 1999



T.Mallard



Remember to change the file locations to your system drives and resources. This coding runs fine with SQL/Access/Oracle...

<%@ language='vbscript' %>
<!-- # include virtual="/asp/adovbs.inc" -->
<% server.scripttimeout = 240 %>
<% buffers = true %>
<%
dim input, output, htmlOut, author, editor, pubdate, topic, source, locale, annotate, errs, err2
dim conn1, conn2, conn3, rsInput, txtOut, rsTemp, pagename, metatopics, secstart, minstart
dim metasOut
metasOut = "D:\Webshare\wwwroot\asp\csfa\csfa_metas.txt"
set conn2 = server.createobject("ADODB.Connection")
  conn2.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\Webshare\wwwroot\asp\csfa\biblio_01.mdb"
  if not isobject(conn2)then
    errs2 = "unable to create access object"
    else errs2 = "access object created"
    end if
dim allfields, sql_01, sql_02
  sql_01 = sql_01 & "SELECT * from v3_86_index"
set rsInput = conn2.execute(sql_01)

rsInput.movefirst
  set conn1 = server.createobject("Scripting.FileSystemObject")
  if not isobject(conn1) then
    errs = "unable to create object"
  else errs = "file object created"
    end if
dim paging, aline, series, sNext, sPrev

while not rsInput.EOF
series = series + 1

for paging =1 to 80
if paging = 1 then
  if series < 100 then
    if series < 10 then
      htmlOut = "D:\Webshare\wwwroot\asp\csfa\csfa_00" & series & ".html"
      sNext = series + 1
      if sNext = 9 then
        htmlNext = "csfa_010.html"
        else
        htmlNext = "csfa_00" & sNext & ".html"
      end if
    sPrev = series - 1
    htmlPrev = "csfa_00" & sPrev & ".html"
    else
    htmlOut = "D:\Webshare\wwwroot\asp\csfa\csfa_0" & series & ".html"
    sNext = series + 1
    htmlNext = "csfa_0" & sNext & ".html"
    sPrev = series - 1
    if sPrev = 9 then
      htmlPrev = "csfa_009.html"
      else
      htmlPrev = "csfa_0" & sPrev & ".html"
    end if
    end if
  else
    htmlOut = "D:\Webshare\wwwroot\asp\csfa\csfa_" & series & ".html"
    sNext = series + 1
    htmlNext = "csfa_" & sNext & ".html"
    if series = 1 then
      htmlPrev = "csfa_001.html"
      else
      sPrev = series - 1
      if sPrev = 99 then
        htmlPrev = "csfa_099.html"
        else
        htmlPrev = "csfa_" & sPrev & ".html"
      end if
    end if
  end if
set output = conn1.opentextfile(htmlOut, 8, True)
output.writeline("<!-- DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'-->")
output.writeline("<html>")
output.writeline("<head>")
output.writeline("<title>General Index - Volume 3, 1986 - Current Research in the Pleistocene</title>")
output.writeline("<meta name='Publisher' content='Center for the First Americans'>")
output.writeline("<meta name='Publisher-email' content='info@mallard.design.com'>")
output.writeline("<meta name='Keywords' content='*'>")
output.writeline("<meta name='Description' content='Current Research in the Pleistocene - Volume 3, 1986'>")
output.writeline("<meta name='Identifier-URL' content='http://www.>")
output.writeline("<meta name='Content-Language' content='en-US '>")
output.writeline("<meta name='Coverage' content='Worldwide'>")
output.writeline("<meta name='Date-created-yyyymmdd' content='19990115'>")
output.writeline("<meta name='Date-Revised-yyyymmdd' content='*'>")
output.writeline("<script language=JavaScript>")
output.writeline("<!-- ")
output.writeline("//-->")
output.writeline("</script>")
output.writeline("<style type='css/text'>")
output.writeline("<!--")
output.writeline(".roll {")
output.writeline("font-family:Arial;")
output.writeline("font-size:14pt;")
output.writeline("text-decoration:none;")
output.writeline("color:black;")
output.writeline("}")
output.writeline("//-->")
output.writeline("</style>")
output.writeline("</head>")
output.writeline("<body bgcolor=ffffff link=0000ff vlink=8e2323 alink=00009c>")
output.writeline("<basefont face='verdana,arial,helvetica' size=2 color=000000>")
output.writeline("<font size=4 color=800000 face='Arial,Helvetica,Verdana'>Current Research in the Pleistocene<br>")
output.writeline("Volume 3, 1986</font><br>")
output.writeline("<font size=3 color=800000 face='Arial,Helvetica,Verdana'><b>General Index</b></font><br>")
output.writeline("<font size=2 color=800000 face='Arial,Helvetica,Verdana'><b>Page " & series & "</b></font><br>")
output.writeline("<table><tr><td>")
end if

if paging = 41 then
    output.writeline("</td><td>")
  else
    if trim(rsInput.Fields("topic")) <> "" then
      metatopics = metatopics & trim(rsInput.Fields("topic")) & ";"
    end if
  aline = trim(rsInput.Fields("topic")) & "  " & trim(rsInput.Fields("subtopic")) & "  "
  if trim(rsInput.Fields("pages")) <> "" then
  aline = aline & "-- " & trim(rsInput.Fields("pages")) & "<br>"
  else
  aline = aline & "<br>"
  end if
  output.writeline(aline)
  aline = ""
end if
rsInput.movenext
if rsInput.EOF then
  paging = 81
    output.writeline("</td></tr></table>")
    output.writeline("<p><center><table cellpadding=4 cellspacing=2 width='10%'><tr><td align=center bgcolor=silver><a href='" & htmlPrev & "'><font face='Comic Sans MS' size='4'>Previous</font></a></td><td align=center bgcolor=silver><a href='csfa_001.html'><font face='Comic Sans MS' size='4'>Start</font></a></td>")
    output.writeline("</tr></table></center><p>")
    output.writeline("<font size=1>Dynamic Content Resources by<br><a href='http://www.mallard-design.com/'>Mallard Design Company</a></font>")
    output.writeline("</body>")
    output.writeline("</html>")
    output.close
end if

next
  set conn3 = server.createobject("Scripting.FileSystemObject")
  if not isobject(conn1) then
    errs = "unable to create object"
  else errs = "file object created"
    end if
set txtOut = conn3.OpenTextFile(metasOut, 8, True)
txtOut.writeline(metatopics)
txtOut.close
metatopics = ""
if not rsInput.EOF then
output.writeline("</td></tr></table>")
if series > 1 then
output.writeline("<p><center><table cellpadding=4 cellspacing=2 width='10%'><tr><td align=center bgcolor=silver><a href='" & htmlPrev & "'><font face='Comic Sans MS' size='4'>Previous</font></a></td><td align=center bgcolor=silver><a href='" & htmlNext & "'><font face='Comic Sans MS' size='4'>Next</font></a></td>")
else
output.writeline("<p><center><table cellpadding=4 cellspacing=2 width='10%'><tr><td align=center bgcolor=silver><a href='" & htmlNext & "'><font face='Comic Sans MS' size='4'>Next</font></a></td>")
end if
output.writeline("</tr></table></center><p>")
output.writeline("<font size=1>Dynamic Content Resources by<br><a href='http://www.mallard-design.com/'>Mallard Design Company</a></font>")
output.writeline("</body>")
output.writeline("</html>")
output.close
end if
wend

totlines = totlines + (series * 80) + paging
totpages = series + 1
htmlOut = "D:\Webshare\wwwroot\asp\csfa\csfa_totals.html"
set output = conn1.opentextfile(htmlOut, 8, True)
output.writeline("")
output.writeline("<!-- DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'-->")
output.writeline("<html>")
output.writeline("<head>")
output.writeline("<title>Current Research in the Pleistocene - Volume 3, 1986</title>")
output.writeline("</head>")
output.writeline("<body bgcolor=ffffff link=0000ff vlink=8e2323 alink=00009c>")
output.writeline("<basefont face='verdana,arial,helvetica' size=2 color=000000>")
output.writeline("<font size=4 color=800000 face='Arial,Helvetica,Verdana'>Current Research in the Pleistocene Volume 3, 1986</font><br>")
output.writeline("<font size=1>Records Processed: " & totlines & "</font><br>")
output.writeline("<font size=1>Pages Processed: " & totpages & "</font><br>")
output.writeline("<font size=1>Date: " & now() & " Seattle, WA</font><br>")
output.writeline("<font size=1>Dynamic Content Resources by<br><a href='http://www.mallard-design.com/'>Mallard Design Company</a></font>")
output.writeline("</body>")
output.writeline("</html>")
output.close
set rsInput = nothing
%>



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