procedure TForm1.Button3Click(Sender: TObject);
var
num:String;
begin
if (application.messagebox('是否确定删除记录!','警告!',MB_yesno)=mryes ) then
begin
num:=query1.FieldByName('职工编号').AsString ;
query1.Close;
query1.SQL.Clear;
Query1.SQL.Text := 'delete from 人员档案 where 职工编号=''' + num +'''';
Query1.ExecSQL;
query1.Close ;
query1.SQL.Clear ;
Query1.SQL.Text := 'select * from 人员档案 order by 职工编号';
Query1.Open ;
end
end;
这是那个按钮的代码,我觉得好像不是代码的问题,是不是系统的问题,还是sql-sever的设置的问题。
var
num:String;
begin
if (application.messagebox('是否确定删除记录!','警告!',MB_yesno)=mryes ) then
begin
num:=query1.FieldByName('职工编号').AsString ;
query1.Close;
query1.SQL.Clear;
Query1.SQL.Text := 'delete from 人员档案 where 职工编号=''' + num +'''';
Query1.ExecSQL;
query1.Close ;
query1.SQL.Clear ;
Query1.SQL.Text := 'select * from 人员档案 order by 职工编号';
Query1.Open ;
end
end;
这是那个按钮的代码,我觉得好像不是代码的问题,是不是系统的问题,还是sql-sever的设置的问题。
你有没有关掉Delphi,后重新打开运行都是一样出现错误呢????
看提示有可能是ADO的问题