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

Microsoft VBScript 编译器错误 错误 '800a0401'
大家帮帮忙,看看我的代码哪里错了?
纠结了一天了


VBScript code

<!--#include file="conn.asp" -->
<%
    dim loginname,pw,sex,realname,job,companyName,address,country,postcode,phone1,phone2,phone3,fax1,fax2,fax3,mobile,weisite,email,contact
    Dim sql
    Dim bbsloginname,bbspassword
    loginname = request("loginname")
    pw = request("password")
    realname = request("realname")
    job = request("job")
    companyName = request("companyName")
    country = request("country")
    address = request("address")
    postcode = request("postcode")
    mobile = request("mobile")
    phone1 = request("phone1")
    phone2 = request("phone2")
    phone3 = request("phone3")
    fax1 = request("fax1")
    fax2 = request("fax2")
    fax3 = request("fax3")
    weisite = request("weisite")
    email = request("email")
    contact = request("contact")

    dim phone,fax

    phone = phone1 & "-" & phone2 & "-" & phone3
    fax = fax1 & "-" & fax2 & "-" & fax3

    bbsloginname = loginname
    bbspassword = pw
    
    sql = "insert into [client](realname,companyName,companyAddress,country,postcode,phone,fax,mobile,weisite,email,createDate,loginname,[password],bbsloginname,bbspassword,job,usertype) values("
    sql = sql & "'" & realname & "',"
    sql = sql & "'" & companyName & "',"
    sql = sql & "'" & address & "',"
    sql = sql & "'" & country & "',"
    sql = sql & "'" & postcode & "',"
    sql = sql & "'" & phone & "',"
    sql = sql & "'" & fax & "',"
    sql = sql & "'" & mobile & "',"
    sql = sql & "'" & weisite & "',"
    sql = sql & "'" & email & "',"
    sql = sql & "now(),"
    sql = sql & "'" & loginname & "',"
    sql = sql & "'" & pw & "',"
    sql = sql & "'" & bbsloginname & "',"
    sql = sql & "'" & bbspassword & "',"
    sql = sql & "'" & job & "',"
    sql = sql & "2)"
    response.Write(sql & "<br/>")
    conn.execute sql,RowsAffected
    if RowsAffected > 0 then
        response.Write(RowsAffected & "行插入<br/>")
        sql = "select id from [client] where loginname = '" & loginname & "'"
        response.Write(sql)
        set rs1 = conn.execute sql    '这行是报错的        
                  if not rs1.eof then
            session("clientID") = rs1("id")
            response.Redirect("Visitor4_1.asp")
        end if
        rs1.close
        if session("clientID") <> "" then
        '    response.Redirect("Visitor4_1.asp")
        else
            response.Write("<script type='text/javascript'>alert('数据处理错误...\n稍候再试...');//history.back(-1);</script>")
        end if
    else
        response.Write("<script type='text/javascript'>alert('数据处理错误...\n稍候再试...');//history.back(-1);</script>")
    end if
%>





------解决方案--------------------
探讨

问题找到了.错误行的代码set rs1 = conn.execute sql 修改为:set rs1 = conn.execute(s