loging allows user to enter even with wrong password entered

Discussion in 'Programming/Html' started by Alexis444, Nov 16, 2016.

  1. Alexis444

    Alexis444 Member Guru

    Messages:
    177
    Likes Received:
    0
    GPU:
    EVGA GTX 950 SSC 2GB
    As the tittle says, the program I'm developing allows the user to enter, even if there is no input in the text box at all. I have the users and passwords stored in a database and I ran a query for the login to use it in the code. So I do not know where I fuc*** up and where is the error. If you put the right user ans pass shows a message box granting access to the program and if you put them wrong grant access also showing the error message. Here some screens
    https://s13.postimg.org/c62ffq8uv/Capture12.png
    https://postimg.org/image/y5qm3gqe5/
     
    Last edited: Nov 16, 2016
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    3,565
    Likes Received:
    8
    GPU:
    GeForce GTX 970
    You assign the query result to variable "login" but the query on the screenshot returns not a scalar value but a set of rows. Have you tried execute that query manually? Does it return anything at all?

    Edit: May be you wanted to write query like:
    Code:
    select count(*) from
    (
    select Username, [Password] 
    from users
    group by Username, [Password]
    having (Username = ?) and ([Password] = ?)
    )
    ?
     
    Last edited: Nov 17, 2016
  3. Alexis444

    Alexis444 Member Guru

    Messages:
    177
    Likes Received:
    0
    GPU:
    EVGA GTX 950 SSC 2GB
    Thank you for your time but the error was on the code. I wrote the Me.Hide() and the Form2.Show() after the end if. Switched them and now works perfectly
     

Share This Page