VB – 表字段数据类型与变量数据类型不符易出现的问题

    已知,表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

故障原因:rs("port")为integer,而tmp(0)为string

因为数据类型的不同导致rs("port")<>tmp(0) …

转载请注明 :IT樵客

此条目发表在 网络技术 分类目录。将固定链接加入收藏夹。

关于 logger

2010年网络规划设计师证书寻挂靠!

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>