create login screen with db2

A

Amy

I have an access application that is basically just a front end to look at
reports. The tables are all linked from a db2 database. On the startup
form, I use a macro to run a select query to get the db2 logon screen to come
up. I don't use access security at all since we have a security model on the
db2 database. It works fine, except I am trying to find a way to handle a
login failure. Right now, with a macro, it pops up odbc failure, and you
have to click halt. I tried using vb, and I get a runtime error, where you
can select end or debug. I'd like to figure out a way to determine if the
login fails(db2), then use a customized msg box to display a more user
friendly message and then let them try again. Any ideas?
 
T

Tom van Stiphout

On Mon, 2 Feb 2009 14:03:00 -0800, Amy <[email protected]>
wrote:

I would definitely use VBA for this. Debug would have been a good
option to choose, so you can step through the code, inspect variables,
and find out what is going on upon login failure.
Then you most likely need an error handler, and when it fires you know
the login failed and you can handle that condition. Something like:
public function TestLogin() as Boolean
dim blnSuccess as boolean
on error goto ErrHandler
'Do the login thing here.
'If we made it here, we must be golden.
blnSuccess = True
ExitFunction:
TestLogin = blnSuccess
Exit Function
ErrHandler:
Msgbox "Yo! That's not a valid login!", vbCritical
blnSuccess = False
resume ExitFunction
end function

-Tom.
Microsoft Access MVP
 

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