|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
create login screen with db2I 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? On Mon, 2 Feb 2009 14:03:00 -0800, Amy <A**@discussions.microsoft.com>
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 Show quoteHide quote >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? Thanks Tom, that was very helpful, it's working now!
Show quoteHide quote "Tom van Stiphout" wrote: > On Mon, 2 Feb 2009 14:03:00 -0800, Amy <A**@discussions.microsoft.com> > 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 > > > >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? >
How to move a secure Db from one laptop to another
Workgroup Information File How to hide database window in Access 2007 access to edit form but not change form Password to open certain report log in passwords Access 2000 Security Can't run dynamic crosstab queries after setting up security 2007 Runtime Security Warning Changes in design |
|||||||||||||||||||||||