代码错误,在线急等!!!!

冰天天 2006-04-26 09:21:39
rs.Open "select id from neirong where title='" & .TextMatrix(.Row, 4) & "'", cn
If Not rs.BOF Then
Dim i As Integer
dim aa as variant
For i = 1 To b
AA(i) = rs("id") '报错 subscript out of range
Next
End If
rs.Close
...全文
93 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lsgis2001 2006-04-26
  • 打赏
  • 举报
回复
dim AA()
redim AA(b) --其中b为数组的大小
顶这个,
itblog 2006-04-26
  • 打赏
  • 举报
回复
把dim aa as variant
改成dim aa() as int试试
OracleRoob 2006-04-26
  • 打赏
  • 举报
回复
--VB代码,使用数组前要先定义,并初始化其大小,否则会提示“下标越界”

dim AA()
redim AA(b) --其中b为数组的大小
onmineroad 2006-04-26
  • 打赏
  • 举报
回复
rs.Open "select id from neirong where title='" & .TextMatrix(.Row, 4) & "'", cn
If Not rs.BOF Then
Dim i As Integer
dim aa as variant
dim AA()
redim AA(b)
For i = 1 To b
AA(i) = rs("id") '报错 subscript out of range
Next
End If
rs.Close

使用数组前要给数组定义大小
Yang_ 2006-04-26
  • 打赏
  • 举报
回复
b
AA
的定义语句?
zlp321002 2006-04-26
  • 打赏
  • 举报
回复
b 多大?是不是数组溢出了??和数据库关系不大!好象是ASP代码吧!到ASP版本问问看.

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧