ASP 101 - Active Server Pages 101 - Web03
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
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash




Script Output:

Tables

Table Name
hit_count
polls
sales
sample
scratch

Back to the Table List

ASP HTML Download            FAQ

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 adovbs.inc file. For more info see the comments near the include command.

A copy of the database is available here.


Samples

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


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers