本帖最后由 fwings260 于 2011-06-02 00:08:51 编辑

解决方案 »

  1.   

    传说有个强制转换函数cint
    n =cint(id)  Check1(n).Caption = 售出
      Check1(n).BackColor = red
      

  2.   

    n = cint(id)但是我觉得你的程序有点问题这个id是怎么来的?
      

  3.   

    额中间修改的时候弄错了
    应该是strid我回去试试 n=cint(strid)
      

  4.   


    用n=cint(strid)说类型不匹配,貌似不能sting和index转换吧用n=val(strid)说 对象变量或with块变量未设置。大家帮忙看看是哪的问题纠结了。。
      

  5.   

    strid = "select 已售出作为 from 售出座位表 where ID =" & strypid
    你的strid 仅仅是一条SQL语句,当然不能cint()了。你要打开一个记录集,通过SQL语句得到你要的id,
    然后再cint(id)
      

  6.   

    dim conn as object,rs as object
    set conn=createobject("adodb.connection")
    conn.open "你的数据库连接字符串(从ADODC1里拷贝出来)"
    if conn.state<>1 then
      set conn=nothing
      msgbox "连库错误,请检查连库字串!"
      goto handler1234567
    end if
    set rs=conn.excute("select 已售出作为 from 售出座位表 where ID =" & strypid)
    dim id%
    id= iif(rs.eof,-1,rs(0)
    if id>=0 then
      id=cint(id)
      .............................
    end if