Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to use multi user login with visual basic 6 and Microsoft access 2007

How to use multi user login with visual basic 6 and Microsoft access 2007

Scheduled Pinned Locked Moved Visual Basic
tutorial
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13659767
    wrote on last edited by
    #1

    Please I need to know the right code to use to access stored user logins in Microsoft access from visual basic 6 login form. Kindly assist as the code i used is not connecting.

    Adodc1.RecordSource = "SELECT * FROM LoginTB WHERE username ='" +

    txtUserName.Text + "'"
    Adodc1.Refresh

    If (Adodc1.Recordset.EOF = False) Then
    	If (txtPassword.Text = Adodc1.Recordset.Fields
    

    ("Password")) Then
    MsgBox ("Login Successful")
    Else
    MsgBox ("Login Failure. Incorrect Password")
    End If
    Else
    MsgBox ("Login Failure. Username does not exist.")
    End If

    L D Richard DeemingR 5 Replies Last reply
    0
    • U User 13659767

      Please I need to know the right code to use to access stored user logins in Microsoft access from visual basic 6 login form. Kindly assist as the code i used is not connecting.

      Adodc1.RecordSource = "SELECT * FROM LoginTB WHERE username ='" +

      txtUserName.Text + "'"
      Adodc1.Refresh

      If (Adodc1.Recordset.EOF = False) Then
      	If (txtPassword.Text = Adodc1.Recordset.Fields
      

      ("Password")) Then
      MsgBox ("Login Successful")
      Else
      MsgBox ("Login Failure. Incorrect Password")
      End If
      Else
      MsgBox ("Login Failure. Username does not exist.")
      End If

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If I didn't know any better, I would think this is part of a scam. Where you from?

      "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

      1 Reply Last reply
      0
      • U User 13659767

        Please I need to know the right code to use to access stored user logins in Microsoft access from visual basic 6 login form. Kindly assist as the code i used is not connecting.

        Adodc1.RecordSource = "SELECT * FROM LoginTB WHERE username ='" +

        txtUserName.Text + "'"
        Adodc1.Refresh

        If (Adodc1.Recordset.EOF = False) Then
        	If (txtPassword.Text = Adodc1.Recordset.Fields
        

        ("Password")) Then
        MsgBox ("Login Successful")
        Else
        MsgBox ("Login Failure. Incorrect Password")
        End If
        Else
        MsgBox ("Login Failure. Username does not exist.")
        End If

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        You seem to be copying and pasting code together, knowing nothing about the code you're using, hoping the frankenstein assemblage you're building works. True?

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        1 Reply Last reply
        0
        • U User 13659767

          Please I need to know the right code to use to access stored user logins in Microsoft access from visual basic 6 login form. Kindly assist as the code i used is not connecting.

          Adodc1.RecordSource = "SELECT * FROM LoginTB WHERE username ='" +

          txtUserName.Text + "'"
          Adodc1.Refresh

          If (Adodc1.Recordset.EOF = False) Then
          	If (txtPassword.Text = Adodc1.Recordset.Fields
          

          ("Password")) Then
          MsgBox ("Login Successful")
          Else
          MsgBox ("Login Failure. Incorrect Password")
          End If
          Else
          MsgBox ("Login Failure. Username does not exist.")
          End If

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          Member 13691861 wrote:

          "SELECT * FROM LoginTB WHERE username ='" + txtUserName.Text + "'"

          Not like that! :doh: Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^] How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^] Query Parameterization Cheat Sheet | OWASP[^] Also: Secure Password Authentication Explained Simply[^] Salted Password Hashing - Doing it Right[^]


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          M 1 Reply Last reply
          0
          • U User 13659767

            Please I need to know the right code to use to access stored user logins in Microsoft access from visual basic 6 login form. Kindly assist as the code i used is not connecting.

            Adodc1.RecordSource = "SELECT * FROM LoginTB WHERE username ='" +

            txtUserName.Text + "'"
            Adodc1.Refresh

            If (Adodc1.Recordset.EOF = False) Then
            	If (txtPassword.Text = Adodc1.Recordset.Fields
            

            ("Password")) Then
            MsgBox ("Login Successful")
            Else
            MsgBox ("Login Failure. Incorrect Password")
            End If
            Else
            MsgBox ("Login Failure. Username does not exist.")
            End If

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Here's a more useful "How to": How to get an answer to your question - Visual Basic Discussion Boards[^]

            1 Reply Last reply
            0
            • Richard DeemingR Richard Deeming

              Member 13691861 wrote:

              "SELECT * FROM LoginTB WHERE username ='" + txtUserName.Text + "'"

              Not like that! :doh: Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^] How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^] Query Parameterization Cheat Sheet | OWASP[^] Also: Secure Password Authentication Explained Simply[^] Salted Password Hashing - Doing it Right[^]


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              I think SQL injection is the least of his problems :sigh:

              Never underestimate the power of human stupidity RAH

              1 Reply Last reply
              0
              • U User 13659767

                Please I need to know the right code to use to access stored user logins in Microsoft access from visual basic 6 login form. Kindly assist as the code i used is not connecting.

                Adodc1.RecordSource = "SELECT * FROM LoginTB WHERE username ='" +

                txtUserName.Text + "'"
                Adodc1.Refresh

                If (Adodc1.Recordset.EOF = False) Then
                	If (txtPassword.Text = Adodc1.Recordset.Fields
                

                ("Password")) Then
                MsgBox ("Login Successful")
                Else
                MsgBox ("Login Failure. Incorrect Password")
                End If
                Else
                MsgBox ("Login Failure. Username does not exist.")
                End If

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                VB6 is no longer supported, and no new code should be written in the language. The compiler isn't sold anymore, and there's no OS for sale that still supports it. There's several problems with your code, SQL-injection just being one of them. You're also storing passwords, which is a security issue. If you want to learn to code then upgrade to VB.NET; if this is part of a course or schoolwork, then I suggest you demand your money back.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                U 1 Reply Last reply
                0
                • L Lost User

                  VB6 is no longer supported, and no new code should be written in the language. The compiler isn't sold anymore, and there's no OS for sale that still supports it. There's several problems with your code, SQL-injection just being one of them. You're also storing passwords, which is a security issue. If you want to learn to code then upgrade to VB.NET; if this is part of a course or schoolwork, then I suggest you demand your money back.

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                  U Offline
                  U Offline
                  User 13659767
                  wrote on last edited by
                  #8

                  Thanks for your response, I am on the verge of upgrading to VB.net. However I need to complete this project. If you still have an idea on how to generate this in VB 6. I will very much appreciate. Thanks

                  L 1 Reply Last reply
                  0
                  • U User 13659767

                    Thanks for your response, I am on the verge of upgrading to VB.net. However I need to complete this project. If you still have an idea on how to generate this in VB 6. I will very much appreciate. Thanks

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Your solution is insecure, in an unsupported language. I oppose both the use of VB6 (a waste of your clients time and money) and the way you're implementing it. Just hardcode a general password in that form and be done with it. If you don't take it seriously, then why should I?

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups