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:
What's the difference between objRS("name") and objRS.Fields("name")?
Show All Tips >>


ASP Developing for Academic and Business Processes
Utilizing ASP in Systems Development
Case: Develop a Research Library Website from Scanned Input

With the connections open...
dim paging, aline, series, sNext, sPrev

while not rsInput.EOF
series = series + 1

The variable 'series' is a page counter, which begins with this while loop. Below is the code to create filenames and Next-Previous links.

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


This section of code above is mainly dealing with getting the automatic paging correct. As the records get processed, I use three digit auto naming so therefore must fill leading zeros for both the filename and for the Next-Previous buttons, so, it's a lot of code for a simple idea. The results are buttons that work and files that sort sequentially by filename. Next is the head portion of the page, which will contain two columns of 40 entries each.


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