pb判定数据表里的某个信息不能为空值。
答案:3 悬赏:40
解决时间 2021-02-07 10:47
- 提问者网友:敏感魔鬼
- 2021-02-07 03:07
pb判定数据表里的某个信息不能为空值。
最佳答案
- 二级知识专家网友:晚安听书人
- 2021-02-07 03:20
比如数据窗口为dw_1,姓名字段为name,学号为id.首选要确定的是多行数据还是一行数据.
①1行数据:
string ls_temp
dw_1.accepttext()//将用户编辑数据窗口的值存入缓存区
ls_temp = dw_1.object.name[1]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','姓名不能为空!')
return
end if
ls_temp = dw_1.object.id[1]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','学号不能为空!')
return
end if
② 多行:
string ls_temp
long i
dw_1.accepttext()//将用户编辑数据窗口的值存入缓存区
for i=1 to dw_1.rowcount()
ls_temp = dw_1.object.name[i]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','第'+string(i)+'行姓名不能为空!')
return
end if
ls_temp = dw_1.object.id[i]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','第'+stirng(i)+'行学号不能为空!')
return
end if
next
①1行数据:
string ls_temp
dw_1.accepttext()//将用户编辑数据窗口的值存入缓存区
ls_temp = dw_1.object.name[1]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','姓名不能为空!')
return
end if
ls_temp = dw_1.object.id[1]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','学号不能为空!')
return
end if
② 多行:
string ls_temp
long i
dw_1.accepttext()//将用户编辑数据窗口的值存入缓存区
for i=1 to dw_1.rowcount()
ls_temp = dw_1.object.name[i]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','第'+string(i)+'行姓名不能为空!')
return
end if
ls_temp = dw_1.object.id[i]
if isnull(ls_temp) or ls_temp ='' then
messagebox('提示','第'+stirng(i)+'行学号不能为空!')
return
end if
next
全部回答
- 1楼网友:浪者不回头
- 2021-02-07 05:29
isnull(姓名) true为空
- 2楼网友:蜜罐小熊
- 2021-02-07 04:25
if isnull(ls_学号) or ls_学号 = '' then
messagebox("学号不能为空!")
return
end if
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯