SHARE
Facebook X Pinterest WhatsApp

Developing from Chaos Page 2

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



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

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.