Hi there! I have an EditBox and a database witch i rote in Microsoft SQL Server 2008. I'm trying to check the text in the editbox with the database! I'm doing this because i have form that checks username and password! I've wrote this : Code: if (Edit1->Text == ADOQuery1->SQL->Text = "Select Username From UsrPass Where Username = 'name') { } but it came out with an error I apresiate any help!
It points in hear about the error: Code: if (Edit1-Text == ADOQuery1->SQL_Text[COLOR=Yellow] [COLOR=Red]=[/COLOR][/COLOR]"Select Username From UsrPass Where Username ='name'") [BCC32 Error] Unit1.cpp(24): E2277 Lvalue required
The statement doesn't make sense, hence the error. But it's one of those statements where you can't tell what exactly is wrong without knowing what you're trying to do. So there's an if, but what are you comparing with what, and why is there an assignment in the middle of the expression?
I would suggest reading the details from the database first, rather than trying to do it in one step. Code: ADOQuery1->SQL_Text="select..." // execute the query // fetch, say into variable x if (Edit1->Text == x) // etc