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:
Controlling How a Page is Cached
Show All Tips >>


Developing from Chaos
Continued

So, I manually copied and pasted from the original Excel file into tables which were created with wizards and default values in Microsoft Access for the database. To the right is the "content" table definitions, note that any number fields need to be listed first, then text fields and memo fields last; it's important in some operations to call them in order as well. OLEDB is used for the connection for speed, ODBC isn't needed as this is workflow on a PC using PWS, a scaled down version of IIS4 as the webserver for win98 to create static html pages for a website using asp.

The dim's aren't necessary, I include them for clarity and while not datatyped, the arrangement is so they can be imported into VisualBasic and turned into a COM object easily (psst, it's also so I don't get lost); the latest tests show that for production performance the dim's should be taken out. Not all variables are used on each page of this series.
The response.write's are for reporting about how many pages were made when the asp is run, so the screen becomes a log in function. For repeatable operations, this can be changed to output to a log file.

<%@ Language=VBScript%>
<!-- # include virtual="/asp/adovbs.inc" -->
<% response.buffers = true %>
<%
dim input, output, htmlOut, author, editor, pubdate, topic, source, locale, annotate, errs, err2
dim conn1, conn2, rsInput, rsOutput, rsTemp, rsCreate
dim check, line, newrecs, allrecs, found, site
dim aline, afields, sql_01, sql_02, sql_03, cmd1
dim adate
adate = date
sql_01 =""
lines = 0
newrecs = 0
alreadys = 0
set conn1 = server.createobject("ADODB.Connection")
conn1.open "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=x:\webshare\wwwroot\gns\cgi\gns_01.mdb"

set rsInput = server.createobject("ADODB.Recordset")
rsInput.open "product", conn1, 2, 3, 2

set rsOutput = server.createobject("ADODB.Recordset")
rsOutput.open "content", conn1, 2, 3, 1

The code above opens a connection to the fresh tables. First is extracting the notes, which are never more than three for the entire product catalog. This page is very simple, it extracts the notes and inserts them. The code checks to see if the current first note is empty, then fills from the previous collection of notes by product type, not by product number; part of the hierarchy I was able to create by using a database. The response.write's are just periods and colons to indicate how many records are processed visually. When this job is done, all the notes are in the Access tables and ready for the pages which follow.

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