CoverYourASP --> Handling exceptions when opening database

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
79 active users
997 visitors today
926 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2016 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Connecting to a database for the first time

CoverYourASP.com has made a name for itself by being the first major Active Server Pages tutorial site to allow readers to download the entire web site and run it on their computers.

One of the most common problems is that a lot of those computers cannot yet run ASP applications, and they do not support technologies such as OLEDB databases or SMTP email that are required to run the site successfully.

Initially, I helped readers by answering their emails, then I created a trouble-shooting section to help them set up their computers successfully.

But it bugged me that a users first impression of my web site after the installation was a screen similar to the one shown below:

ADODB.Connection error '800a0e7a'

Provider cannot be found. It may not be properly installed.

/cya/utils/Database.asp, line 97

So I added exception handling to my utils/database.asp Server Side Include - now the same user sees the message below - a little more helpful, and a much better first impression!

An error has occured while connecting to the database:

   "Provider cannot be found. It may not be properly installed."

Don't despair - this problem is probably well-documented in my trouble-shooting section.

Part 2: Trapping the exception...

Featured sponsor
My favorite resources


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...


Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!