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/
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] = ?) ) ?
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