已知,表vport字段 port (integer),tmp字符串
dim tmp1 as string
tmp=split(tmp,",")
sql="select * from vport"
rs.open sql,cnn,1,3
if not rs.eof then
debug.print tmp(0)
debug.print rs("port")
'测试显示上面两个值一致,但是下面的判断就是不成功
if rs("port")=tmp(0) then
debug.print "Test true!"
end if
end if
tmp=split(tmp,",")
sql="select * from vport"
rs.open sql,cnn,1,3
if not rs.eof then
debug.print tmp(0)
debug.print rs("port")
'测试显示上面两个值一致,但是下面的判断就是不成功
if rs("port")=tmp(0) then
debug.print "Test true!"
end if
end if
故障原因:rs("port")为integer,而tmp(0)为string
因为数据类型的不同导致rs("port")<>tmp(0) …
转载请注明 :IT樵客

