Error 3151 - Connection Failed

L

Lisab

How can I tell the difference between a connection failure due to an invalid
Login and one that failes because the database is unavailable.

I have an Access 2007 application that has linked SYBASE tables from
different Databases.

after the user enteres their userID and password I have code to loop
through the database and relink the Sybase tables. The connection string is
modified using the current user's UID and password.

PROBLEM:
Error 3151 is thrown if the user enters an invalid password
Error 3151 is also thrown if the one of the SYBASE databases is
offline/unavailable.

I need to find a way to distinquish between the two so I can customize what
happens next.

Note: If a connection fails when I manually connect using ODBC, I can tell
by the message if the Login was invalid.
------------------------------------
If the user enters the wrong password/ID, I want to stop, give user warning,
and store the number of invalid attempts. (because after 3 attempts the user
is locked out of the Server and will have to contact the help desk to get
their ID reset)

If the database is offline, I want to record the DBname, then skip to the
next table and continue relinking. If/when we come across another table from
the DB that is unavailable, I want to skip it and continue until all the
tables are relinked or skipped. At the end, the user should be given a
message telling them which DB(s) were unavailable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top