ASP 下标越界有关问题!Microsoft VBScript 运行时异常 (0x800A0009) 下标越界: '[number: 6]'
ASP 下标越界问题!!急急急。Microsoft VBScript 运行时错误 (0x800A0009) 下标越界: '[number: 6]'
菜鸟一只,刚学asp不久,![ASP 下标越界有关问题!Microsoft VBScript 运行时异常 (0x800A0009) 下标越界: '[number: 6]' ASP 下标越界有关问题!Microsoft VBScript 运行时异常 (0x800A0009) 下标越界: '[number: 6]'](/default/index/img?u=aHR0cDovL3d3dy5teWV4Y2VwdGlvbnMubmV0L2ltZy8yMDE1LzExLzE3LzEyMDk0ODgwLmdpZg==)
错误类型:
Microsoft VBScript 运行时错误 (0x800A0009)
下标越界: '[number: 6]'
/FileFolder/Download_File/Download_File_Page.asp, 第 11 行
具体代码如下:
<%
MMM_File_ID=request.querystring("File_ID")
set rs = Server.CreateObject("ADODB.Recordset")
dsnstr= MM_CnRPCenter_STRING
sqlstr= "SELECT * FROM dbo.File_Information WHERE File_ID like '"&MMM_File_ID&"'"
rs.Open sqlstr,dsnstr,3,1
MMM_File_Path=rs("File_Path")
MMMM_File_Path= Split(MMM_File_Path,"\")
MMM_Download_File_Path= MMMM_File_Path(3)&"/"&MMMM_File_Path(4)&"/"&MMMM_File_Path(5)&"/"&MMMM_File_Path(6) (红色字体为第十一行)
MMM_File_System_Name=Cstr(rs.fields.item("File_System_Name").value)
MMM_Download_File_Path_Name="http://192.168.1.100:80/"& MMM_Download_File_Path &"/"& MMM_File_System_Name
rs.Close()
Response.redirect MMM_Download_File_Path_Name
%>
------解决思路----------------------
上面错误提示:下标越界: '[number: 6]'
说明你的数组下标使用6是超了数组长度哦
也就是MMMM_File_Path(6)这个不存在的
------解决思路----------------------
MMM_File_Path有什么内容?自己打印出来看,不懂你数据结构帮你写错来到时也是bug一堆。
数组下标从0开始,你理解成1开始,就修改你的下标-1
如果你的MMM_File_Path分割后不够7项,MMMM_File_Path(6)就越界了
这个没办法帮你,你的MMMM_File_Path都得一样才行,有7项
菜鸟一只,刚学asp不久,
错误类型:
Microsoft VBScript 运行时错误 (0x800A0009)
下标越界: '[number: 6]'
/FileFolder/Download_File/Download_File_Page.asp, 第 11 行
具体代码如下:
<%
MMM_File_ID=request.querystring("File_ID")
set rs = Server.CreateObject("ADODB.Recordset")
dsnstr= MM_CnRPCenter_STRING
sqlstr= "SELECT * FROM dbo.File_Information WHERE File_ID like '"&MMM_File_ID&"'"
rs.Open sqlstr,dsnstr,3,1
MMM_File_Path=rs("File_Path")
MMMM_File_Path= Split(MMM_File_Path,"\")
MMM_Download_File_Path= MMMM_File_Path(3)&"/"&MMMM_File_Path(4)&"/"&MMMM_File_Path(5)&"/"&MMMM_File_Path(6) (红色字体为第十一行)
MMM_File_System_Name=Cstr(rs.fields.item("File_System_Name").value)
MMM_Download_File_Path_Name="http://192.168.1.100:80/"& MMM_Download_File_Path &"/"& MMM_File_System_Name
rs.Close()
Response.redirect MMM_Download_File_Path_Name
%>
------解决思路----------------------
上面错误提示:下标越界: '[number: 6]'
说明你的数组下标使用6是超了数组长度哦
也就是MMMM_File_Path(6)这个不存在的
------解决思路----------------------
MMM_File_Path有什么内容?自己打印出来看,不懂你数据结构帮你写错来到时也是bug一堆。
数组下标从0开始,你理解成1开始,就修改你的下标-1
如果你的MMM_File_Path分割后不够7项,MMMM_File_Path(6)就越界了
这个没办法帮你,你的MMMM_File_Path都得一样才行,有7项