VB help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: VB help

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    VB help

    [Originally posted by harpeace]

    In VB6 I have two texboxes for username and password each.The page is also having a combo box for differinf wether the user is a normal user or an administrator for the program.The page is also having 3 buttons each for login, cancel to clear page, and also help button.So what I want here is developing a command to enable me to login to an appropriate page whenever I want to log in either direct to the program interior after logging in as normal user or administrator to reset the user's password when the user has forgotten their password or want to change their password after clicking the login button.
    Hope your party can help me to do it.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:VB help

    [Originally posted by John Citizen]

    So....

    What part are you having trouble with?


    John Citizen
    NeocomIT
    www.neocomit.com.au

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:VB help

    [Originally posted by harpeace]

    im having trouble with how to connect those two textboxes to the database ie MS Acsess.everytime i enter different username which is not saved inside the Access, the page still take me to the next page(not the admin page).I m using data to link to the Access.

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:VB help

    [Originally posted by harpeace]

    this is the codes which i could not detect where the error is.hope u can solve this.

    Option Explicit
    Public LoginSucceeded As Boolean
    Private Sub Command1_Click()
    Static tries
    Dim search1 As String, search2 As String, target3 As String
    search1 = "USERNAME = '" & Text1 & "'"
    search2 = "PASSWORD = '" & Text2 & "'"
    Form4.Data1.Recordset.FindFirst search1
    Form4.Data1.Recordset.FindFirst search2
    If ((Text1 = "administrator" Or Text1 = "ADMINISTRATOR") And Text2 = "123" And Combo1 = "ADMINISTRATOR") Then
    Unload Me
    Form2.Show
    Else
    If Form4.Data1.Recordset.NoMatch Then
    tries = tries + 1
    If tries >= 3 Then
    MsgBox "You've attempted three times." + Chr(13) + _
    "Please try again later", vbCritical, "Access denied!"
    End
    Else
    MsgBox "The system could not log you on. Make sure your Login ID" + Chr(13) + _
    "and Password enter correctly. Letters in Password must be" + Chr(13) + _
    "typed using the correct letter case. Make sure that Caps Lock" + Chr(13) + _
    "is not accidently on", vbExclamation, "Invalid Login"
    Text1.SetFocus
    SendKeys "{Home}+{End}"
    End If
    Else
    If Combo1 = "Administrator" Then
    MsgBox "", vbOKOnly, "Invalid Password"
    Text2.SetFocus
    SendKeys "{Home}+{End}"
    Else
    Unload Me
    Me.Hide
    Form6.Show
    End If
    End If
    End If
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center