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:
    192
    Likes Received:
    1
    GPU:
    XFX RX 5700XT RAW
    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:
    15,604
    Likes Received:
    13,613
    GPU:
    GF RTX 4070
    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:
    192
    Likes Received:
    1
    GPU:
    XFX RX 5700XT RAW
    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