strid = "select 已售出作为 from 售出座位表 where ID =" & strypid 你的strid 仅仅是一条SQL语句,当然不能cint()了。你要打开一个记录集,通过SQL语句得到你要的id, 然后再cint(id)
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
n =cint(id) Check1(n).Caption = 售出
Check1(n).BackColor = red
应该是strid我回去试试 n=cint(strid)
用n=cint(strid)说类型不匹配,貌似不能sting和index转换吧用n=val(strid)说 对象变量或with块变量未设置。大家帮忙看看是哪的问题纠结了。。
你的strid 仅仅是一条SQL语句,当然不能cint()了。你要打开一个记录集,通过SQL语句得到你要的id,
然后再cint(id)
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