Project *.exe raised exception class EOleException with message.由于其Required 属性设置为真(True),字段‘study.pid’不能包含NULL值。在此字段中输入一个数值。是access数据库。可是在study表中,pid是有值的,为什么说它包含null值??

解决方案 »

  1.   

    是不是你在新插入值时pid是没有值的,这样在保存时就会报错!
      

  2.   

    to snowredhxh(梦醒了) 
     pid是有值的,我是想在study中插入一个name值。
      

  3.   

    估计你在保存时,你的PID字段输入值是空的,你可以在程序中设个断点看一下。
      

  4.   

    谢谢各位!在程序中其实是用不到pid这个字段的,我是这样写的:
      close;
      SQL.Clear;
      SQL.Add('select * from study');
      SQL.Add('where name is null');
      open;
      if ADOQuery1.RecordCount>0 then
       begin
        Append;
        FieldByName('name').AsString:=TmpName;//tmpname是一个string;
        post;//设断点到这里就出现上面的错误
        next;
      end;
      

  5.   

    append追加一条记录,你只是输入了name字段的值,pid是空的。