ASP 101 - Active Server Pages 101
* Samples

Please visit our
Advertising Info

Windows Technology
  15 Seconds
  ASP 101
  ASP Wire
  VB Forums
  VB Wire
  Win Planet

Compare products, prices, and stores at Hardware Central!

Desktops, Mac & PC Notebooks, Monitors, Network Adapters, Firewalls, RAM, Networking Hubs & Switches, Network Accessories, Network Cables, more...

Network Management Tools, Programming Tools, Internet & Communication Applications, Software Suites, Operating Systems, more...

Get the best price on Veritas Backup Exec For Windows Servers or search for other IT Management tools
Interactive Marketing
Internet Lists
Internet News
Internet Resources
Linux/Open Source
Small Business
Windows Technology
Wireless Internet
xSP Resources

Corporate Info
Tech Jobs
E-mail Offers

  Be a Commerce Partner

QUICK TIP: Cache commonly used values in application variables

Script Output:


id (+/-) last_name (+/-) first_name (+/-) sales (+/-)
6 Andersen David 6420
3 Buchanan Steven 3245
10 Callahan Laura 3675
13 Dodsworth Nancy 2750
7 Edwards Frank 3840
1 Fuller Andrew 5000
16 Graham Chris 4050
15 Hopkins Peter 6710
21 Ingraham Owen 4750
9 Jones Edward 3450
5 King Robert 5290
2 Leverling Janet 6250
11 Miller Greg 5640
14 Nelson Beth 4345
18 Ostrander Ian 3965
4 Peacock Margaret 4685
19 Quinn Howard 5865
8 Richards Kate 4260
20 Smith Fred 6370
12 Steel Tammy 3570
17 Thompson Vincent 4820
25 Underwood Debra 3790
24 Valentino Linda 2965
27 White Mark 4500
26 Xavier Simon 5580
22 Youngs Quincy 4420
23 Zimmerman Walter 4980

Back to the Table List


Ok, here's yet another DB sample since that's what everyone seems to want. If you look through this script, you'll see that there are no DB specific commands. This somewhat limits what you can do with it; however, what it does allow, is for this script to work with any DB for which you can set up a DSN or provide a connection string for!!!

That's right boys and girls, this script will work with your DB! All you need to do is set the three constants for the connection string, username, and password, and it's up and running. (If you're using Access, you don't even need to change the username or password unless you've password protected the database!)

I was initially even going to let you choose one or type in your own SQL server address and connection info, but I figured that could very quickly cause problems so I've hard-coded this to our standard sample db.

Here's a quick run down of what it does. When first called it lists the tables in the DB. You select one and it pulls in ALL THE DATA! (So don't use this on your SQL server, 5gig, inventory DB!) From there, you can sort by any column or drill down based on any value. For instance, you connect it to your web server's log file database and you want to see all the hits to a specific page. You simply find an instance of that page and click on it. The script will return all records with a matching value in that field. Even once you're at this stage, you can still sort by any field using the (+/-) in the column heading.

You can't edit anything, but for taking a quick look to see what's up, it sure beats loading up your DB tool, and you can do it from anywhere you can get to a browser. Once again though, be VERY careful of using it on large DB's. It was meant as a quick sample, so it doesn't warn you if you try and open a table with thousands or even millions of lines. If you've got that kind of data, write your own script or at least put in a maximum number of returned records.

The only other issue you may have with it is its use of ADO constants. You'll need to dig out your file. For more info see the comments near the include command.

A copy of the database is available here.


Home | News | Samples | Forum | Articles | Resources | Lessons | Links | Search

Jupiterweb networks


Search Jupiterweb:

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Corporate Info | Newsletters | Tech Jobs | E-mail Offers