Skip to main content
Participant
May 15, 2006
Question

Verifying a Database Connection

  • May 15, 2006
  • 2 replies
  • 207 views
There has to be a easy way to do this. I use dreamweaver to do all my ASP web development. I have a particular application that I want to verify if my database connection is available and, if so, display an appropriate message. Pretty simple I think but I can't seam to figure it out how to do it.

I though maybe a simple "IF... THEN... ELSE..." maybe, such as

IF my_database is available
THEN write "The Database is available"
ELSE write "The Database is NOT available"
END IF

Does anyone know exactly what I need to write in order to do this? In case you need to know I'm connecting to a MS Access database.

Thanks!
This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
May 15, 2006

"CurtTheBeginner" <webforumsuser@macromedia.com> wrote in message
news:e4ap34$8uq$1@forums.macromedia.com...
> There has to be a easy way to do this. I use dreamweaver to do all my ASP
> web
> development. I have a particular application that I want to verify if my
> database connection is available and, if so, display an appropriate
> message.
> Pretty simple I think but I can't seam to figure it out how to do it.

this may be a little on the boring side, what what about having a recordset
on the page that has some sort of query that you now will return data... and
then have two small images (or two sets of text) and then do a "show region"
server behavior? If the recordset = true you show one bit of text... if the
recordset = not true you show the other item.


Participant
May 16, 2006
Would that actually work though? If the database connection is down could you actually perform that test or would the page just fail all together? I'm basically looking for a way to test the connection before performing any queries.