K9 通用版 博客版 主题版 地方门户版 企业版 |   企业(ASP) 分类 使用 分享 疑问 模板 建议 帮助 错误 其他
+新建主题 [Ajax]
填写帐号密码即可完成注册
+新建话题 最新回复排序 最新主题排序 精华帖子

link.asp '[number: 6]' ,无法添加二级栏目

1Next >

xuyunbe1 发表于:12-01-30 16:16 [添加收藏] 楼主 [回复] #Top#
xuyunbe1 人气:1 积分:0 金币:2
Microsoft VBScript 运行时错误 错误 '800a0009' 

下标越界: '[number: 6]' 

link/index.asp,行 914 

--------------------------------------------------------------------------------
link/index.asp,行 914 :data(6,0)=quest("listid1",2)
若是把data(6,0)中的'6'改为0-4这五个数中的任意一个,都不会报错,但是,添加的二级栏目却到一级栏目去了.


相关代码:
sub king_edtlist()
king.head king.path,kc.lang("title")

dim re:re=request.servervariables("http_referer")
if len(form("re"))>0 then re=form("re"):if len(re)=0 then re="index.asp?action=edtlist"

dim rs,data,dataform,sql,i,listid,checkpath
sql="listname,listpath,listkeyword,listdescription,listtitle"'9
listid=quest("listid",2)
if len(listid)=0 then:listid=form("listid")
if len(listid)>0 then'若有值的情况下
if validate(listid,2)=false then king.error king.lang("error/invalid")
end if

if king.ismethod or len(listid)=0 then
dataform=split(sql,",")
redim data(ubound(dataform),0)
for i=0 to ubound(dataform)
data(i,0)=form(dataform(i))
next
if len(quest("listid1",2))>0 then
data(6,0)=quest("listid1",2) end if
else
set rs=conn.execute("select "&sql&" from king__link_list where listid="&listid&";")
if not rs.eof and not rs.bof then
data=rs.getrows()
else
king.error king.lang("error/invalid")
end if
rs.close
set rs=nothing
end if

kc.list

Il "<form name=""form1"" method=""post"" action=""index.asp?action=edtlist"">"

'Il "<p><label>"&kc.lang("label/suplist")&"</label>"&king__list(0,0,data(2,0),listid)&"</p>"

king.form_input "listname",kc.lang("list/listname"),data(0,0),"listname|6|"&encode(kc.lang("check/listname"))&"|1-30"
king.form_input "listtitle",kc.lang("label/listtitle"),data(4,0),"listtitle|6|"&encode(kc.lang("check/listtitle"))&"|1-100"

if len(listid)>0 then'更新
checkpath="listpath|6|"&encode(kc.lang("check/path"))&"|1-100;listpath|15|"&encode(kc.lang("check/path1"))&";listpath|9|"&encode(kc.lang("check/path2"))&"|select count(listid) from king__link_list where listpath='$pro$' and listid<>"&listid
else
checkpath="listpath|6|"&encode(kc.lang("check/path"))&"|1-100;listpath|15|"&encode(kc.lang("check/path1"))&";listpath|9|"&encode(kc.lang("check/path2"))&"|select count(listid) from king__link_list where listpath='$pro$'"
end if
king.form_input "listpath",kc.lang("label/path"),data(1,0),checkpath
king.form_input "listkeyword",kc.lang("label/listkeyword"),data(2,0),"listkeyword|6|"&encode(kc.lang("check/keyword"))&"|0-120"
king.form_area "listdescription",kc.lang("label/listdescription"),data(3,0),"listdescription|6|"&encode(kc.lang("check/description"))&"|0-250"

king.form_but "save"
king.form_hidden "listid",listid
king.form_hidden "re",re

Il "</form>"

if king.ischeck and king.ismethod then
if len(listid)>0 then
conn.execute "update king__link_list set listname='"&safe(data(0,0))&"',listpath='"&safe(data(1,0))&"',listkeyword='"&safe(data(2,0))&"',listdescription='"&safe(data(3,0))&"',listtitle='"&safe(data(4,0))&"' where listid="&listid&";"
else
conn.execute "insert into king__link_list ("&sql&",listorder) values ('"&safe(data(0,0))&"','"&safe(data(1,0))&"','"&safe(data(2,0))&"','"&safe(data(3,0))&"','"&safe(data(4,0))&"',"&king.neworder("king__link_list","listorder")&")"
end if
Il "<script>confirm('"&htm2js(kc.lang("alert/saveok"))&"')?eval(""parent.location='index.asp?action=edtlist'""):eval(""parent.location='"&re&"'"");</script>"
end if
end sub
1064) 数据查询错误:syntax error, unexpected '-'
xutao 发表于:12-01-31 16:36 沙发 [回复] #Top#
xutao 人气:167 积分:42 金币:3584
VIP
有蛋,3等奖

1Next >

发表回复

帐号 匿名发布 审核后可见 [加载完整在线编辑器]
内容
验证码
KingCMS 内容管理系统

关于我们 联系我们 广告报价 付款方式 站点导航

Copyright © 2004-2015 Focuznet All rights reserved.

广州唯众网络科技有限公司 粤ICP备08008106号

中奖了!