C
CobraKing
Unregistered / Unconfirmed
GUEST, unregistred user!
我写一个程序时要求能修改口令,可是总是出错。我的程序是:
procedure TForm2.BitBtn2Click(Sender: TObject);
begin
if (Edit1.Text='') or (Edit3.Text<>Edit4.Text) then
begin
if Edit1.Text='' then
begin
showMessage('Error Please Select a yonghu');
Edit1.SetFocus;
end
else
begin
showMessage('Error! your kouling is Wrong');
Edit3.Text:='';
Edit4.Text:='';
end;
end
else
begin
Query1.Close;
Query1.SQL.Add('Select 雇员号,口令 from guyuan');
Query1.SQL.Add('where 雇员号='+Edit1.Text);
Query1.SQL.Add('and 口令='''+Edit2.Text+'''');
Query1.Open;
if (Query1.RecordCount<>1) or (Edit2.Text<>Query1.FieldValues['口令']) then
begin
ShowMessage('口令不对,请检查!');
Edit2.SelectAll;
end
else
begin
Query1.Edit;
Query1.FieldValues['口令']:=Edit3.Text;
Query1.Post;
ShowMessage('口令修改成功!');
BitBtn1.Click;
end;
end;
end;
出现错误:Project porject1.exe raised exception class EBDEngineError with
message'Invalid field name.
雇员号,口令'.Process stopped.Use Step or Run to contineu.
请高手指教!!200大洋!!!!
procedure TForm2.BitBtn2Click(Sender: TObject);
begin
if (Edit1.Text='') or (Edit3.Text<>Edit4.Text) then
begin
if Edit1.Text='' then
begin
showMessage('Error Please Select a yonghu');
Edit1.SetFocus;
end
else
begin
showMessage('Error! your kouling is Wrong');
Edit3.Text:='';
Edit4.Text:='';
end;
end
else
begin
Query1.Close;
Query1.SQL.Add('Select 雇员号,口令 from guyuan');
Query1.SQL.Add('where 雇员号='+Edit1.Text);
Query1.SQL.Add('and 口令='''+Edit2.Text+'''');
Query1.Open;
if (Query1.RecordCount<>1) or (Edit2.Text<>Query1.FieldValues['口令']) then
begin
ShowMessage('口令不对,请检查!');
Edit2.SelectAll;
end
else
begin
Query1.Edit;
Query1.FieldValues['口令']:=Edit3.Text;
Query1.Post;
ShowMessage('口令修改成功!');
BitBtn1.Click;
end;
end;
end;
出现错误:Project porject1.exe raised exception class EBDEngineError with
message'Invalid field name.
雇员号,口令'.Process stopped.Use Step or Run to contineu.
请高手指教!!200大洋!!!!