+ -
当前位置:首页 → 问答吧 → ASP的问题

ASP的问题

时间:2011-06-29

来源:互联网

代码
VBScript code
<%

    Dim hostName
    hostName=request.servervariables("SERVER_NAME")
    
    hostName=Lcase(hostName)
    if hostName=masterWeb then response.redirect "/login.asp"
    hostName=replace(hostName,"'","")
    
    conn.open constr
    set rs=server.createobject("ADODB.recordset")
    rs.open "select url,utype,udme,title from rewrite where hostname='"&hostName&"' and expries>#"&date()&"#",conn,3,1
    if not rs.eof then
        u_url=rs(0)
        u_tit=rs(2)
        u_type=rs(1)
        title=rs(3)
                u_keywords=rs(5)
        u_Description=rs(5)
        if u_type=1 then
%>


执行到
u_keywords=rs(5)
u_Description=rs(5)

出错,该怎么办?

作者: boruihao   发布时间: 2011-06-29

你一共才4个字段,何来rs(5)?

作者: lzp4881   发布时间: 2011-06-29

url,utype,udme,title
一共就四个字段,你最多只能 rs(3)
5肯定出错

作者: aspwebchh   发布时间: 2011-06-29