Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password protecting a vb/access application.

Status
Not open for further replies.

Giblets

Programmer
Feb 19, 2003
6
GB
Can anyone help me?I'm building an vb/access application and i want to protect it with a username and password.The username and password is stored in the db and I want to verify it somehow, I'm guessing its some sort of loop to go through all the records but could someone help me out.
 
Something like:
form with 2 text boxes and a command button, behind the button is this-

******************************************************

rs.recordsource = "SELECT user, pass FROM table WHERE user='" & txtuser.text & "'"
rs.refresh
if rs.recordcount = 0 then
'there are no users of that name
msgbox "Incorrect login", "Error"
txtuser.text = ""
txtpass.text = ""
txtuser.setfocus
else
'there is a record
if txtpass.text = rs("pass") then
'correct password
me.hide
'enter the application
else
'incorrect password
msgbox "Incorrect Password", "Error"
txtpass.text= ""
txtpass.setfocus
end if
end if
rs.close
'mi casa es su casa'
]-=tty0=-[
ICQ:82621399
 
tty0 : thanks it was nice , but how to let the usename and password with
Windows 9x ,nt: user login system!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top