so, the usernames and passwords are stored in an access database?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Ummm I'm probobly no help...but part of the thing could be done...
IF strUserName="____" AND strPassoword="________" THEN
What happens when you do that
ELSE
It dosn't
END IF
Kiba Ookami
Junior Poster in Training
66 posts since Jan 2005
Reputation Points: 10
Solved Threads: 1
how does the access table look, and what are the field names?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Hi,
Front end Vb6, back end.. access... connection.. ODADB... can someone please help me with the code for login and password.
Hi,
just to give some inputs:
in your form you need to have 2 txt field:
1. txtlogin
2: txtpwd
then:
Private Sub txtpwd_KeyPress(KeyAscii As Integer)
If KeyAscii = vbEnter Then
If Len(Trim(txtlogin)) > 0 And Len(Trim(txtpwd)) > 0 Then
If CheckPwd(txtlogin, txtpwd) = "ok" Then
MsgBox "Password ok"
Else
MsgBox "Wrong password or Login not found."
End If
Else
MsgBox "Login and password should not be blank"
End If
End If
End Sub
Private Function CheckPwd(cLogin As String, cPwd As String)
'in my case i will use dao. you probably using ado just convert it
Dim rs As Recordset, ret As String
Set rs = opendatabase("c:\temp\login.mdb").openrecordset("select * from tbllogin where ucase(trim(logname)) = '" & UCase(Trim(cLogin)) & "'")
If rs.RecordCount <> 0 Then
If UCase(Trim(rs("pword"))) = UCase(Trim(cPwd)) Then
ret = "ok"
Else
ret = "wrong"
End If
Else
ret = "wrong"
End If
rs.Close: CheckPwd = ret
End Function
'This is just to give you an idea. For sure there are lot of ways of doing it...
Newvbguy
NewVBguy
Junior Poster in Training
71 posts since Mar 2005
Reputation Points: 13
Solved Threads: 3
please don't resurrect two year old threads. Thread closed.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343