当前位置:主页>delphi源码/MIS软件> 文章内容

用代码如何为字段赋Null值?

发布时间:2010-01-22 | QQ免费站
1楼: 手工为Char类型字段设Null值我知道是用Ctrl+0,而我用 Adoquery1.FieldByName(‘姓名‘).AsString := Null; 则报错: Undeclared identifier: ‘null‘。 (注:建表时‘姓名‘字段是允许为‘空‘的)。谢谢! 字串6

2楼: Adoquery1.FieldByName(‘姓名‘).AsString := ‘‘; 字串4

3楼: Adoquery1.FieldByName(‘姓名‘).AsString := ‘‘就可以了
字串6

4楼: Adoquery1.FieldByName(‘姓名‘).Value:= Null试试 字串3

5楼: czj_earth的方法不好使。难道就无法赋null值吗?

字串8

6楼: update tablea set field=null where..... hehe,這個肯定可以 ps:我試了czj_earth的方法,可以,不知道樓主是怎麼試的

字串4

7楼: 接受答案了.
字串5