编号 标题
101 AA
102 BB
103 CC
我现在需要定义变量,格式:变量头+编号=标题,如:x101=AA,x102=BB,x103=CC
SQLstr= "Select * From book "
Set rs=conn.Execute(SQLstr,0,1)
While Not(rs.Eof)
x&rs(0)=rs(1)
rs.MoveNext
Wend
我这样写好象不行,向大家请教,多谢~~~
------解决方案--------------------
dim arr
maxLength '从这里来 select count(*) from book 需要减1
SQLstr= "Select * From book "
Set rs=conn.Execute(SQLstr,0,1)
if not (rs.eof or rs.bof) then
redim arr(maxLength, 1)
i = 0
While Not(rs.Eof)
arr(i, 0) = rs(0) '编号
arr(i, 1) = rs(1) '标题
i = i + 1
rs.MoveNext
Wend
end if
------解决方案--------------------
貌似变量名不能用变量来定义吧?!
谢烟客用了数组了~