日期:2014-05-17  浏览次数:21200 次

总是提示“缺少 'End'的错误。盼高手解决。急!急!急!
执行代码如下: <%  
if   Len(Cstr(id)=1)   then
      starnumber1=CInt(Cstr(id)& "00001 ")
      else   if   Len(Cstr(id)=2)   then
                      starnumber1=CInt(Cstr(id)& "0001 ")      
else   if   Len(Cstr(id)=3)   then
                starnumber1=CInt(Cstr(id)& "001 ")  
end   if
endnumber1=starnumber1  
for   i=1   to   total
      exec= "insert   into   xh(classid,xh)   values( "+id+ ", "+endnumber1+ ") "
      conn.execute   exec
      endnumber1=endnumber1+1      
next
       
%>
if语句和end   if语句也相配
但是执行到下面语句处,总是提示“缺少   'End '”
<input   name= "starnumber "   type= "text "   id= "starnumber "   size= "10 "   value= <%=   starnumber   %> >
<input   name= "endnumber "   type= "text "   id= "endnumber "   size= "10 "     value= <%=   endnumber   %> >


------解决方案--------------------
先将
if Len(Cstr(id)=1) then
starnumber1=CInt(Cstr(id)& "00001 ")
else if Len(Cstr(id)=2) then
starnumber1=CInt(Cstr(id)& "0001 ")
else if Len(Cstr(id)=3) then
starnumber1=CInt(Cstr(id)& "001 ")
end if
改成三个IF--END IF看看吧