表中有个int型的字段,现在程序中定义了一个integer型的变量,
insert into talbe values("+变量+",'"+字段1+"','"+字段2+"')
提示类型不匹配,调试发现integer型的变量无法写入int型的字段,
请教该如何写这语句?另外,能介绍下其它需要注意的类型(转换)吗?比如日期
谢谢!

解决方案 »

  1.   

    1 这样写试试
    dim strMobile as string
    dim strSub_code as string
    dim intID as integer
    rw.Execute "insert into ww (ID,MOBILE,SUB_CODE) values("& intID &",'"& strMobile &"','"& strSub_code &"')
      

  2.   

    不会吧,好象是你写的SQL语句不对吧
    insert into TableName (字段名) values(值)
      

  3.   

    dim cn as new adodb.connection
    cn.execute "insert into talbe1 select " & int类型变量 & ",'" & 字符类型变量1 & "','" & 字符类型变量2 &"'"