同样的代码,这样写是否更清晰?
adoqueryOP.Close;
adoqueryOP.SQL.Clear;
adoqueryOP.SQL.Text:= 'update 管理员'
+ 'set xm = ' + QuotedStr(editOPxm.Text)
+ ', password = '+ QuotedStr(editOPpassword.Text)
+ ', type = ' + QuotedStr(combobox1.Text)
+ ', tel = ' + QuotedStr(editOPtel.Text)
+ ', addr = ' + QuotedStr(editOPaddr.Text)
+ ' where id = ' + QuotedStr(editOPID.Text);
adoqueryOP.ExecSQL;
showmessage('修改成功');
adoqueryOP.Close;
adoqueryOP.SQL.Clear;
adoqueryOP.SQL.Text:= 'update 管理员'
+ 'set xm = ' + QuotedStr(editOPxm.Text)
+ ', password = '+ QuotedStr(editOPpassword.Text)
+ ', type = ' + QuotedStr(combobox1.Text)
+ ', tel = ' + QuotedStr(editOPtel.Text)
+ ', addr = ' + QuotedStr(editOPaddr.Text)
+ ' where id = ' + QuotedStr(editOPID.Text);
adoqueryOP.ExecSQL;
showmessage('修改成功');