Guru3D.com Forums

Go Back   Guru3D.com Forums > General > Programming/Html
Programming/Html C++,Visual Basic,HTML,Flash,OpenGL,Modelling,Java.



Reply
 
Thread Tools Display Modes
loging allows user to enter even with wrong password entered
Old
  (#1)
Alexis444
Master Guru
 
Alexis444's Avatar
 
Videocard: EVGA GTX 950 SSC 2GB
Processor: AMD FX 8350 Blk Ed
Mainboard: ASRock 970 Extreme4
Memory: Balistix 12Gb DDR3
Soundcard: VIA HD Audio (onboard)
PSU: Thermal TR2700w
Default loging allows user to enter even with wrong password entered - 11-16-2016, 15:26 | posts: 177 | Location: P.R.

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 by Alexis444; 11-16-2016 at 15:39.
   
Reply With Quote
 
Old
  (#2)
mbk1969
Ancient Guru
 
mbk1969's Avatar
 
Videocard: GeForce GTX 970
Processor: I7-4930
Mainboard: Asus p9x79
Memory: G Skill RipjawZ, 16GB
Soundcard: Onboard + FiiO E17
PSU: 1000 W
Default 11-16-2016, 19:24 | posts: 3,507 | Location: Moscow, Russia

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 by mbk1969; 11-17-2016 at 11:15.
   
Reply With Quote
Old
  (#3)
Alexis444
Master Guru
 
Alexis444's Avatar
 
Videocard: EVGA GTX 950 SSC 2GB
Processor: AMD FX 8350 Blk Ed
Mainboard: ASRock 970 Extreme4
Memory: Balistix 12Gb DDR3
Soundcard: VIA HD Audio (onboard)
PSU: Thermal TR2700w
Default 11-17-2016, 11:41 | posts: 177 | Location: P.R.

Quote:
Originally Posted by mbk1969 View Post
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
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
Copyright (c) 2017, All Rights Reserved. The Guru of 3D, the Hardware Guru, and 3D Guru are trademarks owned by Hilbert Hagedoorn.