T
topdelphi
Unregistered / Unconfirmed
GUEST, unregistred user!
请问我下面的数据库密码语句,那个地方出错了,验证的时候出错了。
procedure TForm1.Button1Click(Sender: TObject);
begin
query1.Close;
query1.SQL.Clear;
QUERY1.SQL.Add('SELECT * FROM A WHERE name='''+TRIM(EDIT1.Text)+
'AND PWD='''+TRIM(EDIT2.Text ));
QUERY1.Open;
showmessage('密码正确');
IF QUERY1.IsEmpty THEN
BEGIN
SHOWMESSAGE('密码不正确');
edit1.SetFocus;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
query1.Close;
query1.SQL.Clear;
QUERY1.SQL.Add('SELECT * FROM A WHERE name='''+TRIM(EDIT1.Text)+
'AND PWD='''+TRIM(EDIT2.Text ));
QUERY1.Open;
showmessage('密码正确');
IF QUERY1.IsEmpty THEN
BEGIN
SHOWMESSAGE('密码不正确');
edit1.SetFocus;
end;
end;