改为
procedure TForm1.Button1Click(Sender: TObject);
begin
table1.open;  
Table1.Insert;
  Table1.FieldByName('XM').AsInteger := StrToInt(Edit1.Text);
try  
Table1.Post;
except
;
end;
end;

解决方案 »

  1.   

    是啊,先要把table打开才能添加嘛
    table.open
    或者
    table.active := true;
      

  2.   

    提示:''is not valib integer value
    还有就是,虽然active是false,但是我我进行了判断的啊
    还是提示:table没有设置为insert or edit
      

  3.   

    打开啦,提示table的模式没有设置。
    但是有这句啊:table1.inser
      

  4.   

    如果服务器设置数据不能修改
    你再怎么用也是白搭。还有你没有检查canmodify的数值,如果canmodify为false调用insert和edit都会抛出异常。if table1.Canmodify=false then
       table1.canmodify:=true;
    table1.insert;
      

  5.   

    我用的是桌面数据库,数据设置也没错啊
    各位能不能给我介绍些网站啊,最好和DELPHI数据库有关的