潮
潮州人
Unregistered / Unconfirmed
GUEST, unregistred user!
源程序如下:
with MyData.ChangePasswd do
begin
Close;
SQL.Clear;
SQL.Add ('select count(*) from Operator where LoginName ="'+UserName+'" and Password ="'+OldPasswd.Text+'"');
Open;
end;
return:=StrToInt(MyData.ChangePasswd.Fields[0].AsString);
if return >= 1 then
begin
if (NewPasswd.Text = NewPasswdOK.Text) then
//更新
begin
with MyData.ChangePasswd do
begin
Close;
SQL.Clear;
SQL.Add('update Operator set Password="'+NewPasswd.Text+'" where LoginName="'+UserName+'"');
ExecSQL;
end
end
else
begin
ShowMsg('你输入的新密码与确认密码不匹配!');
NewPasswdOK.Text := '';
NewPasswdOK.SetFocus;
exit;
end
end
运行时的错误提示:UPDATE的语句的语法错误.
with MyData.ChangePasswd do
begin
Close;
SQL.Clear;
SQL.Add ('select count(*) from Operator where LoginName ="'+UserName+'" and Password ="'+OldPasswd.Text+'"');
Open;
end;
return:=StrToInt(MyData.ChangePasswd.Fields[0].AsString);
if return >= 1 then
begin
if (NewPasswd.Text = NewPasswdOK.Text) then
//更新
begin
with MyData.ChangePasswd do
begin
Close;
SQL.Clear;
SQL.Add('update Operator set Password="'+NewPasswd.Text+'" where LoginName="'+UserName+'"');
ExecSQL;
end
end
else
begin
ShowMsg('你输入的新密码与确认密码不匹配!');
NewPasswdOK.Text := '';
NewPasswdOK.SetFocus;
exit;
end
end
运行时的错误提示:UPDATE的语句的语法错误.