LoginForm->ADOQuery1->SQL->Clear();
LoginForm->ADOQuery1->Close();
AnsiString querystring="select * from Administrator ";
querystring+="where 管理员帐号=";
querystring+="\"";
querystring+=LoginForm->suiEdit1->Text;
querystring+="\"";
LoginForm->ADOQuery1->SQL->Add(querystring);
LoginForm->ADOQuery1->ExecSQL();
LoginForm->ADOQuery1->Active=true;
if(LoginForm->ADOQuery1->RecordCount==0)
{ErrorForm->SnLabel1->Caption="对不起,你输入的帐号错误!";
ErrorForm->Show(); }
else{
querystring+=" and 管理员密码= ";
querystring+="\"";
querystring+=LoginForm->suiEdit2->Text;
querystring+="\"";
LoginForm->ADOQuery1->SQL->Add(querystring);
LoginForm->ADOQuery1->ExecSQL();
LoginForm->ADOQuery1->Active=true;
if(LoginForm->ADOQuery1->RecordCount==0)
{
ErrorForm->SnLabel1->Caption="对不起,你输入的密码错误!";
ErrorForm->Show();}
else
{
MainForm->Show();
LoginForm->Hide();
}
}
--------------------next---------------------
阅读(1426) | 评论(0) | 转发(0) |