Hi!!
I want to make a login prompt for my application in C++ Builder 5. I use ADO to connect to remote db. There is no problem with this.
The problem is, I cant control the wrong login attempts. Here is my OK! button onClick() code:
ADODataSet1->CommandText = "SELECT * FROM tbAdmin WHERE userid = '"+Edit1->Text+"' AND pass = '"+Edit2->Text+"'";
ADODataSet1->Open();
if(ADODataSet1->Eof){
Label3->Caption ="UID or password wrong!";
//ADODataSet1->Active = false; //Line 5
}else{
Form5->Show();
Form1->Hide();
}
----
If user types wrong values, 'if' statement is executed and a message is displayed. The user tries the correct values this time but an error occurs because of the open dataset.
If I uncomment line 5, 'BOF or EOF' error occurs.
Does anyone have a better login prompt code? Please help me?
One more question: Should I use BDE or ADO for SQL Server.
Thanks!!!