简体   繁体   English

vb6运行时错误13

[英]vb6 run time error 13

i am using sql server for database. 我正在使用sql server作为数据库。 In my coding when am inserting integer value into table am getting type mismatch error. 在我的编码中,将整数值插入表时,出现类型不匹配错误。 my code as 我的代码为

set rst1=cnn1.execute("select distinct(tagid) from pgevent")

it returns some values when am trying to insert into another table am getting error 当试图插入另一个表时,它返回一些值

cnn1.execute("insert into tags values("+cint(rst1.fields(0).value)+")")

now am geting error thanks 现在出现错误,谢谢

The error is because you are appending a numeric value to a string. 该错误是因为您要将数字值附加到字符串。

Here are the alternatives 这是替代品

cnn1.execute("insert into tags values(" & cint(rst1.fields(0).value) & ")")

OR 要么

cnn1.execute("insert into tags values("+ rst1.fields(0).value +")")

Use & when you want something to appear as part of the string. 当您希望某些内容出现在字符串中时,请使用&

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM