Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2008
Posts: 161
Reputation: ryan311 has a little shameless behaviour in the past 
Solved Threads: 1
ryan311 ryan311 is offline Offline
Junior Poster

login system

 
0
  #1
Feb 21st, 2009
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

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. Call Opencn
  3. With Combo1
  4. .AddItem ("Administrator")
  5. .AddItem ("User")
  6. End With
  7. End Sub
  8.  
  9. Private Sub lvButtons_H1_Click()
  10. Set rs = New ADODB.Recordset
  11. rs.Open "SELECT * FROM Login WHERE UserName = '" & Text1.Text & "' AND Password = '" & Text2.Text & "'", cn, adOpenKeyset, adLockPessimistic
  12. If Combo1.Text = "Administrator" Then
  13. If rs.RecordCount > 0 Then
  14. frmBegin.Label4.Caption = rs!Fullname
  15. frmBegin.Show
  16. Unload Me
  17. Exit Sub
  18. Else
  19. MsgBox "Your Username or Password is incorrect", vbCritical
  20. End If
  21. End If
  22. End Sub
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,107
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: login system

 
0
  #2
Feb 21st, 2009
Originally Posted by ryan311 View Post
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
please post clearly using correct english and grammer.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 161
Reputation: ryan311 has a little shameless behaviour in the past 
Solved Threads: 1
ryan311 ryan311 is offline Offline
Junior Poster

Re: login system

 
-1
  #3
Feb 21st, 2009
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:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. Call Opencn
  3. With Combo1
  4. .AddItem ("Administrator")
  5. .AddItem ("User")
  6. End With
  7. End Sub
  8.  
  9. Private Sub lvButtons_H1_Click()
  10. Set rs = New ADODB.Recordset
  11. rs.Open "SELECT * FROM Login WHERE UserName = '" & Text1.Text & "' AND Password = '" & Text2.Text & "'", cn, adOpenKeyset, adLockPessimistic
  12. If Combo1.Text = "Administrator" Then
  13. If rs.RecordCount > 0 Then
  14. frmBegin.Label4.Caption = rs!Fullname
  15. frmBegin.Show
  16. Unload Me
  17. Exit Sub
  18. Else
  19. MsgBox "Your Username or Password is incorrect", vbCritical
  20. End If
  21. End If
  22. End Sub
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,107
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: login system

 
0
  #4
Feb 22nd, 2009
how you decide if the user is an admin user or not ?

what is the logic for that ?

is there is corresponding field for that value as well ?
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC