Connecting to a database for the first timeCoverYourASP.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...