[英]vb6 run time error 13
我正在使用sql server作为数据库。 在我的编码中,将整数值插入表时,出现类型不匹配错误。 我的代码为
set rst1=cnn1.execute("select distinct(tagid) from pgevent")
当试图插入另一个表时,它返回一些值
cnn1.execute("insert into tags values("+cint(rst1.fields(0).value)+")")
现在出现错误,谢谢
该错误是因为您要将数字值附加到字符串。
这是替代品
cnn1.execute("insert into tags values(" & cint(rst1.fields(0).value) & ")")
要么
cnn1.execute("insert into tags values("+ rst1.fields(0).value +")")
当您希望某些内容出现在字符串中时,请使用&
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.