473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creating a login process in MS Access 2000-2003

meLady
27
Hello,

I have a table which called "users" and it has two fields "username" and "password".

Also, I have a form that called "User Login", and it has as following:
-txtUsername
-txtPassword
-btnEnter

So, I would like to know how the code goes for this type of idea. I want the user to insert his/her username and password in the login form and then when pressing the Enter button, the system will check and varify the username and password from the users table.

as usual if it wrong ... the error message will be displayed and if it right the next form will be opened ...

I will be more delighted if you could help me in providing the right solutions for my queries which is really new to me (^_^)

I am waiting for your kindly answer.
Apr 23 '07 #1
4 2683
ADezii
8,834 Expert 8TB
Hello,

I have a table which called "users" and it has two fields "username" and "password".

Also, I have a form that called "User Login", and it has as following:
-txtUsername
-txtPassword
-btnEnter

So, I would like to know how the code goes for this type of idea. I want the user to insert his/her username and password in the login form and then when pressing the Enter button, the system will check and varify the username and password from the users table.

as usual if it wrong ... the error message will be displayed and if it right the next form will be opened ...

I will be more delighted if you could help me in providing the right solutions for my queries which is really new to me (^_^)

I am waiting for your kindly answer.
In the Click() Event of btnEntered:
Expand|Select|Wrap|Line Numbers
  1. 'Make sure byou have both a UserName and Password entered
  2. If IsNull(Me![txtUserName]) Or IsNull(Me![txtPassword]) Then Exit Sub
  3.  
  4. If DLookup("username", "users", "username='" & txtUserName & "'") <> "" Then
  5.   'we have a valid UserName, just need a valid UserName/Password combination
  6.   If DLookup("password", "users", "username='" & txtUserName & "'") = Me![txtPassword] Then
  7.     'if you get here, User provided a valid UserName/Password 
  8.     'combination as defined in the users Table
  9.     'GOOD TO GO!!!
  10.   Else
  11.     MsgBox "Invalid Password for User " & Me![txtUserName], vbExclamation, "Invalid Password"
  12.       Exit Sub
  13.   End If
  14. Else
  15.   MsgBox "Invalid User Name", vbExclamation, "Login Failure"
  16.     Exit Sub
  17. End If
NOTE: I would suggest you Index with No Duplicates the username and password Fields for obvious reasons.
Apr 23 '07 #2
pks00
280 Expert 100+
Similar code to that of ADezii but I only check the entered password. Just assume that username is right. If username is wrong then lookup to table will fail anyway.
http://www.thescripts.com/forum/thread627783.html

Just curious ADezii, I hope you dont mind me asking, Im not trying to be rude - why would u want to put a duplicate on both username and password?
My thoughts would be no dups on username but dups index on password
Apr 23 '07 #3
meLady
27
Hello .........

I am confused (`~_~`) ... but I will try ... because I really need to understand the login procedures ... and then if there is any confusions I will return to you guys.

Again thanks a lot for your contributions (^_^)
May 5 '07 #4
ADezii
8,834 Expert 8TB
Similar code to that of ADezii but I only check the entered password. Just assume that username is right. If username is wrong then lookup to table will fail anyway.
http://www.thescripts.com/forum/thread627783.html

Just curious ADezii, I hope you dont mind me asking, Im not trying to be rude - why would u want to put a duplicate on both username and password?
My thoughts would be no dups on username but dups index on password
Please, don't ever feel reluctant about offering additional Input on any of my suggestions. In this case I happen to agree with you, your thoughts make more sense. I just happen to prefer the idea of total uniqueness on both UserName and Password. Thanks for the input.
May 5 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayne Smith | last post by:
Applies to: Microsoft FrontPage 2000, Microsoft Access 2000, IIS 5.0 Operating System: Microsoft Windows 2000 Professional I am trying to protect a portion of a web site by allowing users to...
5
by: RedEye | last post by:
Hello, I am working on a test site to explore the new login controls and membership features of ASP.NET v2.0. I have tested the controls using SQL Express and have now decided to try using a...
9
by: dana lees | last post by:
Hello, I am developing a C# asp.net application. I am using the authentication and authorization mechanism, which its timeout is set to 60 minutes. My application consists of 2 frames - a...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
0
by: muder | last post by:
I have a standard Login ASP.NET 2.0 control on a login Page, a LoginName and LoginStatus controls on the member's page. once the user login successfully I am redirecting the user to Member.aspx...
0
by: Daniel Knöpfel | last post by:
Hello On our asp.net 2.0 website we impersonate every request to the identity of the user logged in. This works this way: 1. user logs in, providing username, password 2. user is authenticated...
0
by: ARC | last post by:
I posted previously about a strategy for importing data from a previous database that is in a different version of Access. I'm going with the strategy of having 2 sets of linked tables, one...
2
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I have a website using windows integrated security, with anonymous access turned off. The site is used to query orders from a database and when the search takes a long time, a windows login box...
1
by: Tim | last post by:
Folks, I have 3 loosely linked problems which I am would appreciate feedback on. 1). T-Sql and Active directory roles. We want to be able to control access to data within a table based on a...
1
by: thaixyz | last post by:
Hi, I am migrating SQL 2000 database from one machine to another using the detach/attach method. I used the TSQL script sp_help_revlogin procedure provided by microsoft to copy the logins, this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.