Windows login form (1 Viewer)

Status
Not open for further replies.

Karma

Registered User.
Local time
Today, 09:14
Joined
Jun 9, 2006
Messages
105
Access 2003:

Purpose: Allows you to use the windows login information User Name Password and domain to control access to a db via a form.

I've hacked this together from various sources.

If you set the form up as your display form Tools>Startup>displayform
then it will be the first form your user encounters. Once they have entered the correct details you can then redirect them to the rest of the database.

Please note i've not got a network with domains here so i've not been able to test that part of the code. If there are no networks it defaults to the computers name.

Karma


Disclaimer:

This Database and the objects there in are provided 'as is' without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of fitness for a purpose, or the warranty of non-infringement. Without limiting the foregoing, Karma makes no warranty that:

the software will meet your requirements
the software will be uninterrupted, timely, secure or error-free
the results that may be obtained from the use of the software will be effective, accurate or reliable
the quality of the software will meet your expectations
any errors in the software obtained will be corrected
Use of this Database and the objects there in should be evaluated against relevant International, national, state/county/region law and company policy.
 

Attachments

  • TESTDB_verify_user_login.zip
    27.5 KB · Views: 5,154
Last edited:

ghudson

Registered User.
Local time
Today, 04:14
Joined
Jun 8, 2002
Messages
6,195
Not bad. This is the first time I have seen a working sample that allows you to verify a users network name and password.

The GetDomains() function [to populate the CMBO_DOMAIN combo box] is not working but it really is not needed since you can grab the users domain name that they are logged into with the Environ function. That should allow you to eliminate the GetDomains(), EnumDomains() and PointerToAsciiStr() functions.

Other than that it works. It validates that your network name is valid and it validates that your password is correct with your network name.

This one line is how you can simply get the users network domain name.
Code:
Environ("USERDOMAIN")
 

Karma

Registered User.
Local time
Today, 09:14
Joined
Jun 9, 2006
Messages
105
Hi,

Thanks for testing it. As i say i haven't got a domain here at work to test it with so that bit was a shot in the dark really. As a matter of interest do you know of another way of enumerating the available domains? I appreciate it's not entirely necessary but i like gilded lilies :)

Cheers

K
 

reclusivemonkey

Registered User.
Local time
Today, 09:14
Joined
Oct 5, 2004
Messages
749
Karma said:
As i say i haven't got a domain here at work to test it with so that bit was a shot in the dark really. As a matter of interest do you know of another way of enumerating the available domains? I appreciate it's not entirely necessary but i like gilded lilies :)

I've just tested this at work, and it found my domain with no problems. If you need any more details, just let me know.
 

ghudson

Registered User.
Local time
Today, 04:14
Joined
Jun 8, 2002
Messages
6,195
Well I just tested it again and this time it did find my domain. :eek:

Is it possible for a person to have more than one domain listed? I am guessing that the answer is no for I think that it is just looking for the domain that you are logged into. If that is the case, then all that code to find a users domain is a waste for the answer can easily be found with just one line of code using the Environ() function.

Code:
Environ("USERDOMAIN")
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom