PC Review


Reply
Thread Tools Rate Thread

create login screen with db2

 
 
Amy
Guest
Posts: n/a
 
      2nd Feb 2009
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?
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      3rd Feb 2009
On Mon, 2 Feb 2009 14:03:00 -0800, Amy <(E-Mail Removed)>
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?

 
Reply With Quote
 
Amy
Guest
Posts: n/a
 
      3rd Feb 2009
Thanks Tom, that was very helpful, it's working now!


"Tom van Stiphout" wrote:

> On Mon, 2 Feb 2009 14:03:00 -0800, Amy <(E-Mail Removed)>
> 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?

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
new account at login screen that i didn't create JM Windows XP General 4 30th Oct 2007 11:55 PM
want to know how to create a login screen that works =?Utf-8?B?cGZhbGVz?= Microsoft Access 1 16th Oct 2007 05:38 PM
how to create login screen in windows application + SQL alfata@gmail.com Microsoft C# .NET 1 13th Nov 2006 09:39 PM
Selecting user at login screen initiates login and instantly logof =?Utf-8?B?d2Fsa2VybWFq?= Windows XP Help 2 5th Jan 2005 12:41 PM
Guest account login - unread messages notification at login screen =?Utf-8?B?d2hpc3RsZXJfaW5fb3o=?= Windows XP General 0 5th Mar 2004 08:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:27 AM.