Microsoft VBScript 编译器错误 错误 '800a0411' 名称重定义

时间:2022-04-02 07:32:16
错误出在—— dim larcode(100) '最多支持100个大类
<%
Set rspin = conn.Execute("select * from adv") 
pin1pic= rspin("hf130pic")
pin1url= rspin("hf130url")
pin1tit= rspin("hf130tit")
pin2pic= rspin("hf131pic")
pin2url= rspin("hf131url")
pin2tit= rspin("hf131tit")
pin3pic= rspin("hf132pic")
pin3url= rspin("hf132url")
pin3tit= rspin("hf132tit")
pin4pic= rspin("hf133pic")
pin4url= rspin("hf133url")
pin4tit= rspin("hf133tit")
pin5pic= rspin("hf134pic")
pin5url= rspin("hf134url")
pin5tit= rspin("hf134tit")
pin6pic= rspin("hf135pic")
pin6url= rspin("hf135url")
pin6tit= rspin("hf135tit")

dim lei1pic(10),lei1url(10),lei1tit(10),cc,ccc
cc=rspin("hf230pic")
for cc=0 to 10
if cc>=5 then ccc=cc+5 else ccc=cc end if
lei1pic(cc)=rspin("hf23"&ccc&"pic")
lei1url(cc)=rspin("hf23"&ccc&"url")
lei1tit(cc)=rspin("hf23"&ccc&"tit")
next
set rspin=nothing

dim larcode(100)    '最多支持100个大类
dim midcode(200)     '最多支持20个中类
dim larroot(200)     '最多支持20个中类
dim larid(200)     '最多支持20个中类
dim larcolor(200)     '最多支持20个中类
dim midcolor(200)     '最多支持20个中类
dim midid(200)
Dim a,b,c
sqllar="select top 10 * from cat where parentstr='0' order by rootid"
Set rsprodtree=Server.CreateObject("ADODB.RecordSet") 
rsprodtree.Open sqllar,conn,1,1 

if not(rsprodtree.bof and rsprodtree.eof) then

i=0
Do While Not rsprodtree.eof
i=i+1
larcode(i)=rsprodtree("catname")
larcolor(i)=rsprodtree("strcolor")
larid(i)=CStr(rsprodtree("catid"))

rsprodtree.movenext
if rsprodtree.eof then exit do
Loop
end if
set rsprodtree=nothing
set sqllar=nothing


FOR t=1 to i
'
weishu=len(larid(t))
lm_link="<a href='class.asp?larCode="&larid(t)&"' target=_blank>"
%>
<div class="wai" style="margin-top:10px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="276" valign="top"><table width="267" border="0" cellpadding="0" cellspacing="0" class="bian4" >
      <tr>
        <td height="32" background="img/23.jpg"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="32" class="title2"><%="<a href='class.asp?larCode="&larid(t)&"' target=_blank><font class='title1'>"&LarCode(t)&"</font></a>"%></td>
              <td align="right"><%="<a href='class.asp?larCode="&larid(t)&"' target=_blank>"%><img src="img/24.jpg" width="47" height="17" border="0" alt="查看更多" /></a></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td class="p1">
  <%
'以下是根据前面读取的大类名称,读取各个大类下的中类
sqllar="select catname,parentid,strcolor,rootid,parentstr,catid from cat where parentstr='"&larid(t)&"' and depth=1 order by orders"
Set rsprodtree=Server.CreateObject("ADODB.RecordSet") 
rsprodtree.Open sqllar,conn,1,1 
erjizong=rsprodtree.RecordCount
m=0
Do While Not rsprodtree.eof
m=m+1

midcode(m)=rsprodtree("catname")
midcolor(m)=rsprodtree("strcolor")
midid(m)=CStr(rsprodtree("catid"))

rsprodtree.movenext
if rsprodtree.eof then exit do
Loop

set rsprodtree=nothing
set sqllar=nothing

w=0

for n=1 to m


w=w+len(MidCode(n))


if midcolor(n)="" then


if w>18 then 
response.write "<br>"
w=len(MidCode(n))
    end if

 
response.write "<a href='class.asp?larCode="&midid(n)&"' target=_blank><font color=#7D5DB1>"&MidCode(n)&"</font></a>"


if n<>erjizong then
w=w+3
if w+len(MidCode(n+1))<19 then 

response.write "<font color=#7D5DB1> | </font>"
end if
   end if
else

if w>18 then 
response.write "<br>"
w=len(MidCode(n))
    end if

response.write "<a href='class.asp?larCode="&midid(n)&"' target=_blank><font color='"&midcolor(n)&"'>"&MidCode(n)&"</font></a>"
if n<>erjizong then
w=w+3
if w+len(MidCode(n+1))<19 then 

response.write "<font color=#7D5DB1> | </font>"
end if
   end if
end if
next
'lei1pic,lei1url,lei1tit
if len(lei1pic(t-1))<>0 then
%><div class="lei_ad" align="center"><a href="<%=lei1url(t-1)%>" target="_blank"><img src="<%=lei1pic(t-1)%>"  alt="<%=lei1tit(t-1)%>" width="230" border="0" /></a></div><%end if%></td>
      </tr>
    </table></td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="38" background="img/32.jpg"><table width="688" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="38" class="title1" style="padding-left:60px;"><%=LarCode(t)%></td>
        <td align="right"><%=lm_link%><img src="img/2.gif" alt="查看更多" width="47" height="17" border="0" /></a></td>
      </tr>
    </table>
          </td>
      </tr>
      <tr>
        <td class="bian33 p2"><table border="0" cellpadding="0" cellspacing="0">
          <tr><TD width="690" align=middle> 
                        <%
response.write "<table border=0 cellpadding=0 cellspacing=0  width='100%'>"
'set rs=conn.execute("select  top 6 * from bproduc  where larcode="&larid(t)&" or left(midcode,"&weishu+1&") ='"&larid(t)&",' order by AddDate desc")

set rs=conn.execute("select  top 10 * from bproduc  where larcode="&larid(t)&" or left(midcode,"&weishu+1&") ='"&larid(t)&",' order by AddDate desc")

if rs.bof and rs.eof then
response.write "<tr><td height=150 align=center><font color=#BBA8D8><b>暂时没有商品</b></font></td></tr>"
else
   k=0
   Do While Not rs.eof
response.write "<tr>"
    for i=1 to 10
k=k+1

response.write "<td align='center' valign='top' width=134 height=100>"
response.write "<table border=0 cellspacing=0 cellpadding=1 valign=middle align=center  width=134 height=100>"
response.write "<tr><td align=center valign=middle><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><img  border=0 onload=Reset_ImgSize(this,120,120);  alt="&rs("ProdName")&" src="&rs("ImgPrev")&"></a></td></tr>"
response.write "<tr><td align=center><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><font color=#BBA8D8>"&lleft(rs("ProdName"),18)&"</font></a></td></tr>"
response.write "</table></td>"
if (k mod 5=0) then
response.write "</tr><tr>"
end if
rs.movenext
if k>10 then exit do
    next

loop
response.write "</tr>"
end if
set rs=nothing
response.write "</table>"

select case t
case 1
i_s=pin1url:i_a=pin1pic:i_t=pin1tit
case 2
i_s=pin2url:i_a=pin2pic:i_t=pin2tit
case 3
i_s=pin3url:i_a=pin3pic:i_t=pin3tit
case 4
i_s=pin4url:i_a=pin4pic:i_t=pin4tit
case 5
i_s=pin5url:i_a=pin5pic:i_t=pin5tit
case 6
i_s=pin6url:i_a=pin6pic:i_t=pin6tit
case 7
i_s=pin7url:i_a=pin7pic:i_t=pin7tit
case 8
i_s=pin8url:i_a=pin8pic:i_t=pin8tit
case 9
i_s=pin9url:i_a=pin9pic:i_t=pin9tit
case 10
    i_s=pin10url:i_a=pin10pic:i_t=pin10tit
case else
i_s=pin1url:i_a=pin1pic:i_t=pin1tit
end select

%></TD>
                </TR>
                  </TBODY>
                </TABLE></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
<%next%>

1 个解决方案

#1


在你的代码中search一下"larcode"看看不是文件中或引用的文件中有重复的定义

#1


在你的代码中search一下"larcode"看看不是文件中或引用的文件中有重复的定义