SQL中的某个字段为NULL,当在VB中用文本框显示时出错,请问高手如何解决?
我正在写一个程序,其中有写字段的值可以为空如下:
create table student_info
( studnet_id int not null primary key,
studnet_name char(10) null,
..... null
comment varchar(200) null,
)
当comment或其他字段的值为空时,出错text不能接受null
dim rs as adodb.recordset
strsql="select * from student_info"
rs.open strsql.........
text1.text=rs.fields(....)
text2.text=rs.fields(...)
....
textn.text=rs.fields(comment)
难道每个字段都要判断一下NULL再赋值吗?(如果有30个字段)有没有更好的办法(字段必须可以为空)