procedure Tmainfrm.Button1Click(Sender: TObject);
begin
adoQuery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Text:='select PPassword from dl where PAdministrator='''+edit1.text+'''';
adoQuery1.Open;if edit2.Text=adoquery1.FieldByName('PPassword').AsString
then manage.Show;end;
哪位高手幫我改一下.我這個在是輸入密碼的時候總是說密碼不正確,可
我明明是輸入的正確的密碼.
begin
adoQuery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Text:='select PPassword from dl where PAdministrator='''+edit1.text+'''';
adoQuery1.Open;if edit2.Text=adoquery1.FieldByName('PPassword').AsString
then manage.Show;end;
哪位高手幫我改一下.我這個在是輸入密碼的時候總是說密碼不正確,可
我明明是輸入的正確的密碼.
begin
adoQuery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Text:='select PPassword from dl where PAdministrator='"'+edit1.text+'"';//改了这里, 试试吧
adoQuery1.Open;if edit2.Text=adoquery1.FieldByName('PPassword').AsString
then manage.Show;end;
begin
adoQuery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Text:='select PPassword from dl where PAdministrator=' + '"'+ edit1.text + '"';//改了这里, 试试吧
adoQuery1.Open;if edit2.Text=adoquery1.FieldByName('PPassword').AsString
then manage.Show;end;
begin
adoQuery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Text:='select PPassword from dl where PAdministrator=''''+trim(edit1.text)+'''';
adoQuery1.Open;if edit2.Text=adoquery1.FieldByName('PPassword').AsString
then manage.Show;end;
then manage.Show;是没去掉空格吧! 试试看!
begin
adoQuery1.Close;
adoquery1.SQL.Clear;
adoQuery1.SQL.Text:='select PPassword from dl where PAdministrator='''+edit1.text+'''';
adoQuery1.Open;
if adoquery1.recordcount>0 then
showmessage('该用户存在');
if edit2.Text=adoquery1.FieldByName('PPassword').AsString
then manage.Show;
end;
//或者有同名用户
教我怎麼給你分