Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21264

how check an employee if his status is active or not before logging in to the system

$
0
0
im trying to check if the status activity of a user is false or not before he enteres the system however i did some coding and when i try to enter a name it dosnt do nothing at all
if a user that is active in the system still same thing.
this is the code:
Code:

If Txt(0).text = "" Then
MsgBox "name is empty", vbExclamation
Txt(0).SetFocus
Exit Sub
End If

If Txt(1).text = "" Then
MsgBox "יpassword is empty", vbExclamation
Txt(1).SetFocus
Exit Sub
End If

Set rs = CN.Execute("select EmpName, EmpActive from Employees where EmpName= '" & RplS(Txt(0).text) & "'")
If Not rs.EOF Then
    Select Case rs![EmpActive]
        Case "Not Active"
            MsgBox "this user cannot login beacuse he is registered as not active", vbExclamation, ""
                Txt(9).text = ""
       
       
  Case Else


 Set rs = CN.Execute("SELECT UserName, UserPass FROM Users WHERE UserName= '" & RplS(Txt(0).text) & "'")
    If rs.EOF Then
        MsgBox "name doesnt exists in the database, ""
        Txt(0).text = ""
        Txt(1).text = ""
        Txt(0).SetFocus
    ElseIf Txt(1).text <> rs!UserPass Then
        MsgBox "wrong password", vbInformation, ""
        Txt(1).text = ""
        Txt(1).SetFocus
    Else
        UsLogin = Txt(0).text
        Unload Me
         
        End If
          End Select
        frmload.Show 1
    End If


Viewing all articles
Browse latest Browse all 21264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>