| | |
login system
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 161
Reputation:
Solved Threads: 1
help how can i know if the user is not an admin
i have combo box in my combo box have a user or admin additem if he choose admin then all i want is to validate if the username and password is for admin user this is my code
i have combo box in my combo box have a user or admin additem if he choose admin then all i want is to validate if the username and password is for admin user this is my code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Form_Load() Call Opencn With Combo1 .AddItem ("Administrator") .AddItem ("User") End With End Sub Private Sub lvButtons_H1_Click() Set rs = New ADODB.Recordset rs.Open "SELECT * FROM Login WHERE UserName = '" & Text1.Text & "' AND Password = '" & Text2.Text & "'", cn, adOpenKeyset, adLockPessimistic If Combo1.Text = "Administrator" Then If rs.RecordCount > 0 Then frmBegin.Label4.Caption = rs!Fullname frmBegin.Show Unload Me Exit Sub Else MsgBox "Your Username or Password is incorrect", vbCritical End If End If End Sub
•
•
Join Date: Jul 2008
Posts: 161
Reputation:
Solved Threads: 1
help how can i know if the user is not an admin
i have combo box, in my combo box have a user or admin additem, if he choose admin then all i want is to validate if the username and password is for admin user, this is my code:
i have combo box, in my combo box have a user or admin additem, if he choose admin then all i want is to validate if the username and password is for admin user, this is my code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Form_Load() Call Opencn With Combo1 .AddItem ("Administrator") .AddItem ("User") End With End Sub Private Sub lvButtons_H1_Click() Set rs = New ADODB.Recordset rs.Open "SELECT * FROM Login WHERE UserName = '" & Text1.Text & "' AND Password = '" & Text2.Text & "'", cn, adOpenKeyset, adLockPessimistic If Combo1.Text = "Administrator" Then If rs.RecordCount > 0 Then frmBegin.Label4.Caption = rs!Fullname frmBegin.Show Unload Me Exit Sub Else MsgBox "Your Username or Password is incorrect", vbCritical End If End If End Sub
![]() |
Similar Threads
- Website Login (ASP.NET)
- member login system in php (PHP)
- Login System Help (Visual Basic 4 / 5 / 6)
- Simple Login System: Need Advice. (PHP)
- login scripts (PHP)
- Trying to create a login system (PHP)
- Consultant Infomation System (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: please help badly needed!
- Next Thread: Help Please: data type mismatch in criteria expression
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






