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.
4 2683 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: - 'Make sure byou have both a UserName and Password entered
-
If IsNull(Me![txtUserName]) Or IsNull(Me![txtPassword]) Then Exit Sub
-
-
If DLookup("username", "users", "username='" & txtUserName & "'") <> "" Then
-
'we have a valid UserName, just need a valid UserName/Password combination
-
If DLookup("password", "users", "username='" & txtUserName & "'") = Me![txtPassword] Then
-
'if you get here, User provided a valid UserName/Password
-
'combination as defined in the users Table
-
'GOOD TO GO!!!
-
Else
-
MsgBox "Invalid Password for User " & Me![txtUserName], vbExclamation, "Invalid Password"
-
Exit Sub
-
End If
-
Else
-
MsgBox "Invalid User Name", vbExclamation, "Login Failure"
-
Exit Sub
-
End If
NOTE: I would suggest you Index with No Duplicates the username and password Fields for obvious reasons.
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
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 (^_^)
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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.
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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
|
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...
|
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,...
|
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,...
|
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...
| |