ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 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
105 active users
750 visitors today
1126 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2008 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

Tiki Statues - Tiki Masks - Tiki Totems


CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?


New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!