| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1670 人关注过本帖
标题:困扰我3天的asp后台管理页面提交成html页面失败问题 错误类型:Microsoft ...
只看楼主 加入收藏
天空云朵
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-2-21
结帖率:0
收藏
已结贴  问题点数:20 回复次数:9 
困扰我3天的asp后台管理页面提交成html页面失败问题 错误类型:Microsoft OLE DB Provider for ODBC Drivers (0
在本地调试asp网站时出现以下错误,传到空间后还是出现以下错误。

希望热心的老师给予帮助,谢谢!

---------------------------------------------------

以下是错误表现------

试图访问的网页出现问题,无法显示。

--------------------------------------------------------------------------------

请尝试执行下列操作:

单击刷新按钮,或稍后重试。

打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务

--------------------------------------------------------------------------------

技术信息(用于支持人员)

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]行中有错误
/Manager/HotelSystem/ProductEdit.asp, 第 249 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

网页:
POST 3636 ??? /Manager/HotelSystem/ProductEdit.asp

POST Data:
错误 '80020009'
发生意外。

/iisHelp/common/500-100.asp,行 219

--------------------------------------------

ProductEdit.asp  源码内容如下:

ProductEdit.asp 后台信息提交页面

第249行 是   oRs.Update()   代码
搜索更多相关主题的帖子: localhost Internet 服务器 空间 老师 
2011-02-22 00:05
天空云朵
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-2-21
收藏
得分:0 
    End If

    oRs("IsNew") = IsNew
    oRs("IsSpecial") = IsSpecial
    oRs("SortIndex") = SortIndex
    oRs("keyTitle") = strTitle
    oRs("keyKeywords") = strKeywords
    oRs("keyDescription") = strDescription
    oRs("fileName") = strFileName
        
    oRs.Update()
    oRs.Close()
   
    If nID = 0 then
       nID = oConn.Execute("Select * From Hotel order by ID desc")(0)
    End If
2011-02-22 00:10
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:5 
    End If

    oRs("IsNew") = IsNew
    oRs("IsSpecial") = IsSpecial
    oRs("SortIndex") = SortIndex
    oRs("keyTitle") = strTitle
    oRs("keyKeywords") = strKeywords
    oRs("keyDescription") = strDescription
    oRs("fileName") = strFileName
        
    oRs.Update()
    oRs.Close()
   
    If nID = 0 then
       Set RsId = oConn.Execute("Select * From Hotel order by ID desc")
       nID=RsId.Fields(0).Value
    End If
2011-02-22 10:15
天空云朵
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-2-21
收藏
得分:0 
版主您好,感谢您的及时回答,祝愿本论坛越办越好!

按您的修正又经过本地测试,可还是出现同样问题。

为了您能看全代码,现将ProductEdit.asp  网页全部代码复制内容如下:请您指正,谢谢!

---------------------------------------------------------------------------------

<!-- #include file="../../Component/Class_Startup.asp" -->
<!-- #include file="../../Component/CheckLogin.asp" -->
<!-- #include file="../../Component/Ixinde_Upload.asp" -->
<!-- #include file="../Include/ConnectionString.inc" -->
<%
'======================================
'检查是否登录,或登录超时
'注意:一定要包含CheckLogin.asp组件
'======================================
Dim oLogin
Set oLogin = New Ixinde_CheckLogin
If Not oLogin.CheckLogin Then
    Set oLogin = Nothing
    Response.Write("<script>alert('登录已超时,请重新登录系统。');top.location.href='../Login.asp';</script>")
    Response.End()
End If
Set oLogin = Nothing
'======================================

'======================================
'检查地址的有效性
'======================================
If Not SQLFormater() Then
    Response.Write("<script>alert('无效地址.');</script>")
    Response.End()
End If
'======================================


Dim sSQL, oRs, nCatID, nURL, nID, act,strSQL
Dim name
Dim Ename
Dim keyword
Dim province
Dim city
Dim star
Dim starNo
Dim price
Dim money
Dim address,liebiao
Dim imgSource
Dim pic1
Dim pic2
Dim pic3
Dim mappic
Dim intro
Dim telephone
Dim fax
Dim food
Dim entertainment
Dim service
Dim traffic
Dim OtherInfo
Dim Info
Dim SortIndex,strTitle,strKeywords,strDescription,strFileName
Dim IsNew
Dim IsSpecial

act = Request("act")
nID = Request.QueryString("ID")
nCatID = Request.QueryString("CatID")

If Not IsNumeric(nID) Then
    nID = 0
End If

If Not IsNumeric(nCatID) Then
    nCatID = 0
End If

If act = "" Then
    act = "2"
End If

DBConnBegin(ConnectionString)

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
   
    Dim oUpload
    Set oUpload = New Ixinde_Upload
   
    act = oUpload.Form("act")
    nID = oUpload.Form("txtID")
    nCatID = oUpload.Form("txtCatID")
    nURL = oUpload.Form("txtURL")

    Dim rsCatParent, nParentID, Description2
    sSQL = "Select * From HotelCategory Where ID=" & nCatID
    Set rsCatParent = oConn.Execute(sSQL)
    If Not (rsCatParent.EOF And rsCatParent.BOF) Then
        nParentID = rsCatParent("ParentID")
        Description2 = rsCatParent("Description2")
    End If
    rsCatParent.Close()
    Set rsCatParent = Nothing

    If nID = 0 Then
       nURl = "ProductView.asp?CatID="&nCatID&"&ParentID="&nParentID
    End If

    province = oUpload.Form("province")
    city = oUpload.Form("city")
    Name = oUpload.Form("Name")
    Ename = oUpload.Form("Ename")
    keyword = oUpload.Form("keyword")
    starNo = oUpload.Form("starNo")
   
    select case starNo
    case 1
    star = "一星"
    case 2
    star = "准二星"
    case 3
    star = "二星"
    case 4
    star = "准三星"
    case 5
    star = "三星"
    case 6
    star = "准四星"
    case 7
    star = "四星"
    case 8
    star = "准五星"
    case 9
    star = "五星"   
    end select
   
    price = oUpload.Form("price")
    money = oUpload.Form("money")
    address = oUpload.Form("address")
    liebiao = oUpload.Form("liebiao")
    intro = oUpload.Form("intro")
    telephone = oUpload.Form("telephone")
    fax = oUpload.Form("fax")
    food = oUpload.Form("food")
    entertainment = oUpload.Form("entertainment")
    service = oUpload.Form("service")
    traffic = oUpload.Form("traffic")
    OtherInfo = oUpload.Form("OtherInfo")
    Info = oUpload.Form("Info")
   
    IsSpecial = oUpload.Form("chkSpecial")
    If IsSpecial = "" Then
        IsSpecial = "0"
    End If
    IsNew = oUpload.Form("chkNew")
    If IsNew = "" Then
        IsNew = "0"
    End If

    SortIndex = oUpload.Form("txtSortIndex")
    strTitle = oUpload.Form("txtTitle")
    strKeywords = oUpload.Form("txtKeywords")
    strDescription = oUpload.Form("txtDescription")
    strFileName = oUpload.Form("txtFileName")
   
    Dim formPath, formName, dtMonth
    formPath = "..\UploadImage\"   ''定义图片存放的路径,文件夹要先建好
    dtMonth = Month(Now())
    For Each formName In oUpload.Files
        Dim oFile
        Set oFile = oUpload.File(formName)  
        If oFile.FileSize > 0 Then
            Dim file_exet, fileName
            file_exet = Ucase(Mid(oFile.FileName, InStr(oFile.FileName, ".") + 1)) '获取扩展名
            
        '    If UCase(file_exet)="GIF" Or UCase(file_exet)="JPG" Or UCase(file_exet)="JPEG" Or UCase(file_exet)="ICO" Or UCase(file_exet)="bmp" Then
                fileName = formPath & dtMonth & "\" & Year(Now()) & Month(Now()) & Day(Now()) & Hour(Now()) & Minute(Now()) & Second(Now()) & formName & "." & file_exet
                oFile.SaveAs Server.MapPath(fileName)
               
                select case LCase(formName)
                case "txtpicturebig"
                    imgSource = fileName
                case "pic1"
                    pic1 = fileName
                case "pic2"
                    pic2 = fileName
                case "pic3"
                    pic3 = fileName
                case "mappic"
                    mappic = fileName               
                end select
            'End If
        End If
        Set oFile = Nothing
    Next
            
    'Response.Write act & "<br>" & nID & "<br>" & nParentID & "<br>" & CatName & "<br>" & SortIndex & "<br>" & Icon
    'Response.End()

    Set oRs = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * From Hotel Where ID=" & nID
    oRs.ActiveConnection = ConnectionString
    oRs.Source = sSQL
    oRs.CursorType = 1
    oRs.CursorLocation = 2
    oRs.LockType = 3
    oRs.Open
    If nID=0 Then oRs.AddNew()
   
    oRs("Name") = Name
    oRs("EName") = EName
    oRs("keyword") = keyword
    oRs("province") = province
    oRs("city") = city
    oRs("star") = star
    oRs("starNo") = starNo
    If price <> "" Then
    oRs("price") = price
    End If
    oRs("money") = money
    oRs("address") = address
    oRs("liebiao") = liebiao
'    oRs("intro") = intro
    oRs("telephone") = telephone
    oRs("fax") = fax
'    oRs("food") = food
'    oRs("entertainment") = entertainment
    oRs("service") = service
    oRs("traffic") = traffic
    oRs("OtherInfo") = OtherInfo
    oRs("Info") = Info

    If imgSource <> "" Then
        oRs("imgSource") = imgSource
    End If
    If pic1 <> "" Then
        oRs("pic1") = pic1
    End If
    If pic2 <> "" Then
        oRs("pic2") = pic2
    End If
    If pic3 <> "" Then
        oRs("pic3") = pic3
    End If
    If mappic <> "" Then
        oRs("mappic") = mappic
    End If

    oRs("IsNew") = IsNew
    oRs("IsSpecial") = IsSpecial
    oRs("SortIndex") = SortIndex
    oRs("keyTitle") = strTitle
    oRs("keyKeywords") = strKeywords
    oRs("keyDescription") = strDescription
    oRs("fileName") = strFileName
        
    oRs.Update()         ---------这个是第249行出错的代码--------
    oRs.Close()
   
    If nID = 0 then
       nID = oConn.Execute("Select * From Hotel order by ID desc")(0)
    End If
   
'    If nID=0 Then
'       oRs.open "select top 1 ID from News order by ID desc",conn,1,1
'       nID=oRs(0)
'       oRs.close
'    End if
            oConn.Execute("Delete from Hotelfang where ParentID = " & nID)

            Dim Tn ,ii
            ii = oUpload.Form("Acount") - 1        
   
            For Tn = 1 To ii
            
    If oUpload.Form("txtAnswer_"&Tn) <> "" Then
               
    Set oRs = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * From Hotelfang Where ID=0"               
    oRs.ActiveConnection = ConnectionString
    oRs.Source = sSQL
    oRs.CursorType = 1
    oRs.CursorLocation = 2
    oRs.LockType = 3
    oRs.Open
    oRs.AddNew()
   
    oRs("ParentID") = nID
    oRs("Answer") = oUpload.Form("txtAnswer_"&Tn&"")
    oRs("price_can") = oUpload.Form("price_can_"&Tn&"")
    oRs("price_te") = oUpload.Form("price_te_"&Tn&"")
    oRs("content") = oUpload.Form("content_"&Tn&"")
   
    oRs.Update()            
    oRs.Close()   
                    
    End If        
            
            Next   
            
    set oUpload = Nothing
   
    DBConnEnd()
   
    Dim strRedirect,strSourceUrl

    strRedirect="jiudian"
    'strSourceUrl=request("sourceUrl") & ""
    strSourceUrl="/jiudian/jiudian.asp?ID=" & nID'要生成的目标文件
    strFileName=strFileName
    '写入到文件
    Write2file strRedirect,strSourceUrl,strFileName
    '参数说明:strRedirect文件目录,strSourceUrl资源地址,strFileName文件名        
    'response.write strSourceUrl
    'response.end
   
    Response.Write("<script>location.href='"&nURL&"';alert('操作成功.');</script>")
    response.end
   
End If
   
If nID = 0 Then
    Name = ""
    EName = ""
    keyword = ""

    sSQL = "Select * From HotelCategory Where IsDelete = 0 and ID=" & nCatID
    Set rsCatParent = oConn.Execute(sSQL)
    If Not (rsCatParent.EOF And rsCatParent.BOF) Then
        nParentID = rsCatParent("ParentID")
        If nParentID = 0 Then
           province = rsCatParent("Name")
        Else
           province = oConn.Execute("Select name From HotelCategory Where IsDelete = 0 and ID=" & nParentID)(0)
           city = rsCatParent("Name")
           Description2 = rsCatParent("Description2")
           If Description2 <> "" Then
              city = city&"("&Description2&")"
           End If               
        End If   
    End If
    rsCatParent.Close()
    Set rsCatParent = Nothing
   
    starNo = 9
    price = 0.00
    money = "RM"
    address = ""
    liebiao = ""
    imgSource = ""
    pic1 = ""
    pic2 = ""
    pic3 = ""
    mappic = ""
    intro = ""
    telephone = ""
    fax = ""
    food = ""
    entertainment = ""
    service = ""
    traffic = ""
    OtherInfo = ""
    Info = ""
            
    IsSpecial = 0
    IsNew = 0
    SortIndex = 0
Else
    sSQL = "Select * From Hotel Where ID=" & nID
    Set oRs = oConn.Execute(sSQL)
    If (oRs.EOF And oRs.BOF) Then
        Response.Write("<script>alert('没有找到指定记录,可能已经被删除。');history.back();</script>")
        Response.End()
    End If
   
    Name = oRs("Name") & ""
    EName = oRs("EName") & ""
    keyword = oRs("keyword") & ""
    province = oRs("province") & ""
    city = oRs("city") & ""
    star = oRs("star") & ""
    starNo = oRs("starNo") & ""
    price = oRs("price") & ""
    money = oRs("money") & ""
    address = oRs("address") & ""
    liebiao = oRs("liebiao") & ""
    imgSource = oRs("imgSource") & ""
    pic1 = oRs("pic1") & ""
    pic2 = oRs("pic2") & ""
    pic3 = oRs("pic3") & ""
    mappic = oRs("mappic") & ""
    intro = oRs("intro") & ""
    telephone = oRs("telephone") & ""
    fax = oRs("fax") & ""
    food = oRs("food") & ""
    entertainment = oRs("entertainment") & ""
    service = oRs("service") & ""
    traffic = oRs("traffic") & ""
    OtherInfo = oRs("OtherInfo") & ""
    Info = oRs("Info") & ""
   
    IsSpecial = oRs("IsSpecial")
    IsNew = oRs("IsNew")
    SortIndex = oRs("SortIndex")
    strTitle = oRs("keyTitle")
    strKeywords = oRs("keyKeywords")
    strDescription = oRs("keyDescription")
    strFileName = oRs("fileName")
End If

    Dim rsLable
    Dim iLable
    strSQL="select parentID from hotelCategory where ID=" & nCatID
    'response.write strSQL
    Set rsLable = oConn.execute(strSQL)
    If Not (rsLable.bof And rsLable.eof) Then
       iLable=rsLable(0)
    End if
    Set rsLable = Nothing

    If iLable=5 Or iLable="" Then
       iLable=153
    Else
       iLable=154
    End if
   
%>
<html>
<head>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
2011-02-22 17:31
天空云朵
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-2-21
收藏
得分:0 
    <title>酒店信息维护</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="../js/WindowFunctions.js"></script>
    <script language="javascript">
    <!--
        function fCheckOnOff(obj)
        {
            obj.value = (obj.checked?1:0);
            //alert(obj.value);
        }
        
        function fCheckOnOffForLabel(obj)
        {
            obj.checked = !obj.checked;
            obj.value = (obj.checked?1:0);
            //alert(obj.value);
        }
        
        function fCheckForm()
        {
            if (!trim(document.frmProduct.Name.value))
            {
                alert('验证错误,名称为空,请输入。');
                document.frmProduct.Name.focus();
                return false;
            }
            
            /*if (!isNumeric(document.frmProduct.txtPrice.value))
            {
                alert('验证错误,产品价格为空或格式不符,请重新输入。');
                document.frmProduct.txtPrice.focus();
                return false;
            }
            
            if (!isNumeric(document.frmProduct.txtMemberPrice.value))
            {
                alert('验证错误,产品会员价格为空或格式不符,请重新输入。');
                document.frmProduct.txtMemberPrice.focus();
                return false;
            }
            
            if (!isNumeric(document.frmProduct.txtDiscount.value))
            {
                alert('验证错误,产品折扣为空或格式不符,请重新输入。');
                document.frmProduct.txtDiscount.focus();
                return false;
            }
            */
            if (!isDigit(document.frmProduct.txtSortIndex.value))
            {
                alert('验证错误,排序编号为空或格式不符,请重新输入。');
                document.frmProduct.txtSortIndex.focus();
                return false;
            }
            
            if (!trim(document.frmProduct.txtPictureBig.value) || !trim(document.frmProduct.txtPictureSmall.value))
            {
                if (!window.confirm('您还没有选择产品图片,确定不上传产品图片吗?\n\n按“确定”不传,\n按“取消”重新选择。'))
                {
                    document.frmProduct.txtPictureBig.focus();
                    return false;
                }
            }
            
            return true;
        }
    -->
    </script>
<%
Dim sql, rs, count
sql = "select *,(select name from HotelCategory where ID=H.ParentID) as Pname from HotelCategory H where ParentID <> 0 order by SortIndex,id"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,oConn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof%>
subcat[<%=count%>] = new Array("<%= trim(rs("Name"))%>","<%= trim(rs("Pname"))%>","<%= trim(rs("Name"))%>");
        <%count = count + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing%>
onecount=<%=count%>;

function changelocation(ypxxone)
    {
    document.frmProduct.city.length = 0;

    //var ypxxone_id=city;
    var i;
    document.frmProduct.city.options[0] = new Option('请选择小类','');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == ypxxone)
            {
                document.frmProduct.city.options[document.frmProduct.city.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }   
</script>
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" scroll="yes">
   
<table cellSpacing="0" cellPadding="0" width="78%" border="0">
  <tr>
            <td width="100%" valign="top">
                <table class="up" cellSpacing="0" cellPadding="3" width="100%" border="0">
                    <tr>
                        <td class="title" noWrap background="../images/title_back.gif" height="22"><IMG height="16" hspace="0" src="../images/xp38.gif" width="16" align="absMiddle"><span>酒店信息维护</span></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="100%" valign="top">
                <table class="up" borderColor="#efefef" bgcolor="#F0F0EC" cellSpacing="0" cellPadding="0" width="100%" border="1">
                    <tr>
                        <td vAlign="middle" noWrap width="0" height="25"><IMG height="22" src="../images/t_header.gif" width="6" align="absMiddle">
                        <td onMouseUp="this.className='up';location.reload();" onMouseDown="this.className='down';"
                            onmouseover="this.className='up'" title="刷新" style="CURSOR: default" onMouseOut="this.className=''"
                            width="0%"><IMG height="16" hspace="5" src="../images/refresh.gif" width="16" align="absMiddle"></td>
                        <td width="0%"><IMG height="22" src="../images/split.gif" width="6" align="absMiddle"></td>
                        <td onMouseUp="this.className='up';"
                            onmousedown="this.className='down';location.href='ProductEdit.asp?act=0&ID=0&CatID=<%=nCatID%>';" onMouseOver="this.className='up'" title="添加"
                            style="CURSOR: default" onMouseOut="this.className=''" noWrap width="0%"><img height="16" hspace="5" src="../images/add.gif" width="16" align="absMiddle"><font style="FONT-SIZE: 12px">添加&nbsp;</font></td>
                        <td width="0%"><IMG height="22" src="../images/split.gif" width="6" align="absMiddle"></td>
                        <td onMouseUp="this.className='up';"
                            onmousedown="this.className='down';" onMouseOver="this.className='up'" title="删除"
                            style="CURSOR: default" onMouseOut="this.className=''" noWrap width="0%"><img height="16" hspace="5" src="../images/delete.gif" width="16" align="absMiddle"><font style="FONT-SIZE: 12px">删除&nbsp;</font></td>
                        <td width="0%"><IMG height="22" src="../images/split.gif" width="6" align="absMiddle"></td>
                        <td vAlign="middle" noWrap width="100%" height="25"></td>
                    </tr>
                </table>
            </td>
        </tr>
        <form action="ProductEdit.asp" method="POST" enctype="multipart/form-data" name="frmProduct" onSubmit="javascript:return fCheckForm();">
        <input type="hidden" name="act" value="<%=act%>">
        <input type="hidden" name="txtID" value="<%=nID%>">
        <input type="hidden" name="txtCatID" value="<%=nCatID%>">
        <input type="hidden" name="txtURL" value="<%=Request.ServerVariables("HTTP_REFERER")%>">
        <tr>
            <td>
                <table width="650" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#C0C0C0">
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店名称:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="Name" type="text" id="Name" size="40" maxlength="50" value="<%=Name%>">            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">英文名称:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="Ename" type="text" id="Ename" size="40" maxlength="50" value="<%=Ename%>">            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">关键字:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="keyword" type="text" id="keyword" size="40" maxlength="50" value="<%=keyword%>">            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店电话:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="telephone" type="text" id="telephone" size="40" maxlength="50" value="<%=telephone%>">            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店传真:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="fax" type="text" id="fax" size="40" maxlength="50" value="<%=fax%>">            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店地址:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="address" type="text" id="address" size="40" maxlength="50" value="<%=address%>">            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店星级:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><select name="starNo">
<option value="9" <% if starNo = 9 then %>selected<% end if %>>五星</option>
<option value="8" <% if starNo = 8 then %>selected<% end if %>>准五星</option>   
<option value="7" <% if starNo = 7 then %>selected<% end if %>>四星</option>   
<option value="6" <% if starNo = 6 then %>selected<% end if %>>准四星</option>   
<option value="5" <% if starNo = 5 then %>selected<% end if %>>三星</option>   
<option value="4" <% if starNo = 4 then %>selected<% end if %>>准三星</option>   
<option value="3" <% if starNo = 3 then %>selected<% end if %>>二星</option>   
<option value="2" <% if starNo = 2 then %>selected<% end if %>>准二星</option>   
<option value="1" <% if starNo = 1 then %>selected<% end if %>>一星</option>                  
            </select></td>
          </tr>
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">所属地区:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><%=province%> >> <%=city%><br><select name="province" onChange="changelocation(document.frmProduct.province.options[document.frmProduct.province.selectedIndex].value)">
<option value="" <% if province = "" then %>selected<% end if %>>请选择大类</option>
                    <%
sql="select *  from HotelCategory where ParentID = 0 and isdelete=false order by SortIndex,id"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,oConn,1,1
while not rs.eof%>
<option value="<%=rs("Name")%>" <% if Cstr(province) = Cstr(rs("Name")) then %>selected<% end if %>><%=rs("Name")%></option>
<%rs.movenext
wend
rs.Close()
%>
            </select>
<select name="city">
<option <% if city = "" then %>selected<% end if %> value="">请选择小类</option>
</select>            </td>
          </tr>
<tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">标签列表:</td>
            <td height="24" bgcolor="#FFFFFF">
<%
    Dim nPage,n,i,nPageCount,nRecordcount

   set rs=server.createobject("adodb.recordset")
   
        sSQL="select * from HotelCategory2 where parentID=" & iLable & " and isdelete=0 Order By Name desc"
        
   rs.open sSQL,oConn,1,1

        rs.PageSize = 800000
        nPageCount = rs.PageCount
        nRecordcount = rs.recordcount
   
    If Request.QueryString("Page") = "" then
        nPage = 1
    Else
        nPage = Int(Request.QueryString("Page"))
    End if
    If nPage < 1 Then
        nPage = 1
    End If
    If nPageCount=0 then
        response.write "<DIV align=center><br>暂无相关信息!</div>"
    Else
        rs.AbsolutePage = nPage
   
        n = 1
        Do While not rs.eof and n<=400000
%>
               
        <table width="94%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>        
<%        
            For i=1 to 2
                If Not rs.EOF then
%>
            <td width="50%"><table width="97%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="5%" height="24"><input name="liebiao" type="checkbox" value="<%=rs(1)%>" <% If instr(liebiao,rs(1)) Then Response.Write("checked") %>></td>
                        <td width="95%" class="text1"><A href="jiudian.asp?id=<%=rs(0)%>" title="<%=rs(1)%>" target="_blank"><%=rs(1)%></A></td>
                      </tr>
                      <tr>
                        <td></td>
                        <td background="images/xian1.jpg"><img src="images/xian1.jpg" width="3" height="1"></td>
                      </tr>
                    </table></td>
<%                                                        
                    rs.movenext
                Else
                    If i = 2 And rs.Eof Then
                        Response.Write("<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>")
                    End If
                    exit for
                End If
               
            Next   
            
               
            n = n + 1
%>

            </tr>   
        </table>
        <%            
        Loop
    End If
   
    rs.close
    set rs = nothing
%>
            </td>
          </tr>
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店形象图:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="txtPictureBig" type="file" size="40"></td>
          </tr>
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店介绍图1:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="pic1" type="file" size="40"></td>
          </tr>   
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店介绍图2:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="pic2" type="file" size="40"></td>
          </tr>   
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店介绍图3:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="pic3" type="file" size="40"></td>
          </tr>   
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店地图:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="mappic" type="file" size="40"></td>
          </tr>                                                                    
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">参考价:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="price" type="text" id="price" size="20" maxlength="50" value="<%=price%>">
                <label>
                  <input name="money" type="radio" value="RM" <% if money = "RM" or money = "" then %>checked<% end if %>>
                  RMB</label>
                <label>
                  <input type="radio" name="money" value="HK" <% if money = "HK" then %>checked<% end if %>>
                  HKD</label>                </td>
          </tr>
          <!--tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">娱乐与健身设施:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><textarea name="entertainment" cols="60" rows="6"><%=entertainment%></textarea>            </td>
          </tr-->
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店简介:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><table width="94%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><INPUT type="hidden" name="Info" value="<%=Server.HtmlEncode(Info)%>"> <IFRAME ID="eWebEditor1" src="../eWebEditor/ewebeditor.asp?id=Info" frameborder="0" scrolling="no"  width="530" height="300"></IFRAME>
                    <span class="style3">*</span></td>
                </tr>
              </table></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店设施:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><textarea name="service" cols="60" rows="6"><%=service%></textarea>            </td>
          </tr>         
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店地图:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><textarea name="traffic" cols="60" rows="6"><%=traffic%></textarea>            </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">酒店备注 :</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><textarea name="OtherInfo" cols="60" rows="6"><%=OtherInfo%></textarea>            </td>
          </tr>         
          <tr bgcolor="#FFFFFF">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0"></td>
            <td width="530" height="24" bgcolor="#FFFFFF"> <input name="chkSpecial" type="checkbox" id="chkSpecial" value="<%If IsSpecial Then Response.Write "1" Else Response.Write "0" End If%>" <%If IsSpecial Then Response.Write "checked"%> onClick="javascript:fCheckOnOff(this);">
              <label id="lblSpecial" onClick="javascript:fCheckOnOffForLabel(document.all['chkSpecial']);">特价推荐</label>
              &nbsp; <input name="chkNew" type="checkbox" id="chkNew" value="<%If IsNew Then Response.Write "1" Else Response.Write "0" End If%>" <%If IsNew Then Response.Write "checked"%> onClick="javascript:fCheckOnOff(this);">
              <label id="lblNew" onClick="javascript:fCheckOnOffForLabel(document.all['chkNew']);">首页推荐</label>              </td>          </tr>
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">排序编号:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="txtSortIndex" type="text" id="txtSortIndex" size="5" maxlength="10" value="<%=SortIndex%>">
              &nbsp;(数字越小越靠前)</td>
          </tr>
          <tr bgcolor="#E0E0E0">
            <td width="120" height="24" align="right" bgcolor="#E0E0E0">房型信息:</td>
            <td width="530" height="24" bgcolor="#FFFFFF"><input name="button" type="button" id="button" value="添加房型" style="width:200px;height:22px;background-color:#f0f0f0;border-left: 0 solid #000000;border-right: 0 solid #000000;border-top: 0 solid #000000;border-bottom: 0 solid #000000;" onClick="AddInput()"><br>
            <span id="AnswerAll">
                <%
                    Dim x
                    x = 1

                    Dim rsTemp
                    Set rsTemp = oConn.Execute("Select * From Hotelfang Where ParentID = " & nID)

                    If rsTemp.Eof Then
                %>
                        <label style="width:55px"></label>客房种类<%=x%>:<input name="txtAnswer_<%=x%>" type="text" id="txtAnswer_<%=x%>" size="10" maxlength="10" value="">参考价:<input name="price_can_<%=x%>" type="text" id="price_can_<%=x%>" size="10" maxlength="10" value="0" <% if x=1 then %>onBlur="javascript:document.frmProduct.price.value=document.frmProduct.price_can_1.value"<% end if %>>优惠价:<input name="price_te_<%=x%>" type="text" id="price_te_<%=x%>" size="10" maxlength="10" value="0"><br>备注:<textarea name="content_<%=x%>" cols="50" rows="4"></textarea><br>
                <%
                        x = x + 1
                    else
                        While Not rsTemp.Eof
                %>
                        <label style="width:55px"></label>客房种类<%=x%>:<input name="txtAnswer_<%=x%>" type="text" id="txtAnswer_<%=x%>" size="10" maxlength="10" value="<%=Trim(rsTemp("Answer"))%>">参考价:<input name="price_can_<%=x%>" type="text" id="price_can_<%=x%>" size="10" maxlength="10" value="<%=rsTemp("price_can")%>" <% if x=1 then %>onBlur="javascript:document.frmProduct.price.value=document.frmProduct.price_can_1.value"<% end if %>>优惠价:<input name="price_te_<%=x%>" type="text" id="price_te_<%=x%>" size="10" maxlength="10" value="<%=rsTemp("price_te")%>"><br>备注:<textarea name="content_<%=x%>" cols="50" rows="4"><%=rsTemp("content")%></textarea><br>
                <%
                            rsTemp.MoveNext
                            x = x + 1
                        Wend
                    End If
                %>
              </span>
            </td>
          </tr>   
            <tr bgcolor="#FFFFFF">
              <td height="30" align="right" bgcolor="#E0E0E0">Title:</td>
              <td height="30"><input name="txtTitle" type="text" id="txtTitle" value="<%=strTitle%>" size="80"></td>
          </tr>
            <tr bgcolor="#FFFFFF">
              <td height="30" align="right" bgcolor="#E0E0E0">Keywords:</td>
              <td height="30"><input name="txtKeywords" type="text" id="txtKeywords" value="<%=strKeywords%>" size="80"></td>
          </tr>
            <tr bgcolor="#FFFFFF">
              <td height="30" align="right" bgcolor="#E0E0E0">Description:</td>
              <td height="30"><TEXTAREA NAME="txtDescription" ROWS="5" COLS="80"><%=strDescription%></TEXTAREA></td>
          </tr>
            <tr bgcolor="#FFFFFF">
              <td height="30" align="right" bgcolor="#E0E0E0">文件名:</td>
              <td height="30"><input name="txtFileName" type="text" id="txtFileName" value="<%=strFileName%>" size="80"></td>
          </tr>

          <tr bgcolor="#FFFFFF">
            <td width="120" height="30" align="right" bgcolor="#E0E0E0">&nbsp;</td>
            <td width="530" height="30"><input type="submit" name="btnOK" value=" 确定 " class="button3">
              &nbsp; <input type="button" name="btnCancel" value=" 取消 " class="button3" onClick="javascript:location.href='Info.asp'"></td>
          </tr>
        </table>
        <input type="hidden" name="Acount" value="<%=x%>">
                <br>
                <table width="600" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#C0C0C0">
                    <%
                    If imgSource <> "" Then
                    %>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" height="20">酒店形象图</td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" align="center">
                            <img src="<%=imgSource%>" border="0" align="absmiddle">                        </td>
                    </tr>
                    <%
                    End If
                    %>
                    <%
                    If pic1 <> "" Then
                    %>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" height="20">酒店介绍图1</td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" align="center">
                            <img src="<%=pic1%>" border="0" align="absmiddle">                        </td>
                    </tr>
                    <%
                    End If
                    %>
                    <%
                    If pic2 <> "" Then
                    %>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" height="20">酒店介绍图2</td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" align="center">
                            <img src="<%=pic2%>" border="0" align="absmiddle">                        </td>
                    </tr>
                    <%
                    End If
                    %>
                    <%
                    If pic3 <> "" Then
                    %>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" height="20">酒店介绍图3</td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" align="center">
                            <img src="<%=pic3%>" border="0" align="absmiddle">                        </td>
                    </tr>
                    <%
                    End If
                    %>
                    <%
                    If mappic <> "" Then
                    %>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" height="20">酒店地图</td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                        <td width="600" align="center">
                            <img src="<%=mappic%>" border="0" align="absmiddle">                        </td>
                    </tr>
                    <%
                    End If
                    %>                                                                                                                                
                </table>
            </td>
        </tr>
        </form>
        <tr>
            <td></td>
        </tr>
    </table>
<script language="javascript">
    changelocation(document.frmProduct.province.options[document.frmProduct.province.selectedIndex].value);
    document.frmProduct.city.value = "<%=city%>";
</script>
<script>
    function AddInput()
    {
        var thisObject = document.frmProduct;
        var TempAcount = thisObject.Acount.value;

        var AnswerAll = document.all("AnswerAll").innerHTML;
        
        var TbInfo;
        //alert(TempAcount++)

        TbInfo = "<label style='width:55px'></label>客房种类"+thisObject.Acount.value+":<input name='txtAnswer_"+thisObject.Acount.value+"' type='text' id='txtAnswer_"+thisObject.Acount.value+"' size='10' maxlength='10' value=''>参考价:<input name='price_can_"+thisObject.Acount.value+"' type='text' id='price_can_"+thisObject.Acount.value+"' size='10' maxlength='10' value='0'>优惠价:<input name='price_te_"+thisObject.Acount.value+"' type='text' id='price_te_"+thisObject.Acount.value+"' size='10' maxlength='10' value='0'><br>备注:<textarea name='content_"+thisObject.Acount.value+"' cols='50' rows='4'></textarea><br>"


        document.all("AnswerAll").innerHTML = AnswerAll + TbInfo;
        thisObject.Acount.value = ++TempAcount;
    //alert(document.all("AnswerAll").innerText)
    }
</script>   
</body>
</HTML>
<%
Call DBConnEnd()
%>
 

2011-02-22 17:32
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:5 
Set oRs = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * From Hotel Where ID=" & nID
    oRs.ActiveConnection = ConnectionString
    oRs.Source = sSQL
    oRs.CursorType = 1
    oRs.CursorLocation = 2
    oRs.LockType = 3
    oRs.Open
    If nID=0 Then oRs.AddNew()
-->
 Set oRs = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * From Hotel Where ID=" & nID
    oRs.Open sSQL,oConn,1,3
    If nID=0 Then
    oRs.AddNew()

QQ:63572063
2011-02-22 18:17
天空云朵
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-2-21
收藏
得分:0 
程序代码:
           
    蝙蝠侠您好,首先感谢您的关注和修正,可是按您修正后还是出错,请您再给看看,谢谢了。在线等
-------------------------------------------------------------------------------------------------

   'Response.Write act & "<br>" & nID & "<br>" & nParentID & "<br>" & CatName & "<br>" & SortIndex & "<br>" & Icon
    'Response.End()

    Set oRs = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * From Hotel Where ID=" & nID
    oRs.ActiveConnection = ConnectionString
    oRs.Source = sSQL
    oRs.CursorType = 1
    oRs.CursorLocation = 2
    oRs.LockType = 3
    oRs.Open
    If nID=0 Then oRs.AddNew()
   
    oRs("Name") = Name
    oRs("EName") = EName
    oRs("keyword") = keyword
    oRs("province") = province
    oRs("city") = city
    oRs("star") = star
    oRs("starNo") = starNo
    If price <> "" Then
    oRs("price") = price
    End If
    oRs("money") = money
    oRs("address") = address
    oRs("liebiao") = liebiao
'    oRs("intro") = intro
    oRs("telephone") = telephone
    oRs("fax") = fax
'    oRs("food") = food
'    oRs("entertainment") = entertainment
    oRs("service") = service
    oRs("traffic") = traffic
    oRs("OtherInfo") = OtherInfo
    oRs("Info") = Info

    If imgSource <> "" Then
        oRs("imgSource") = imgSource
    End If
    If pic1 <> "" Then
        oRs("pic1") = pic1
    End If
    If pic2 <> "" Then
        oRs("pic2") = pic2
    End If
    If pic3 <> "" Then
        oRs("pic3") = pic3
    End If
    If mappic <> "" Then
        oRs("mappic") = mappic
    End If

    oRs("IsNew") = IsNew
    oRs("IsSpecial") = IsSpecial
    oRs("SortIndex") = SortIndex
    oRs("keyTitle") = strTitle
    oRs("keyKeywords") = strKeywords
    oRs("keyDescription") = strDescription
    oRs("fileName") = strFileName
       
    oRs.Update()               --------------这段代码是第249行出错的代码--------------
    oRs.Close()
   
    If nID = 0 then
       nID = oConn.Execute("Select * From Hotel order by ID desc")(0)
    End If
   
'    If nID=0 Then
'       oRs.open "select top 1 ID from News order by ID desc",conn,1,1
'       nID=oRs(0)
'       oRs.close
'    End if
            oConn.Execute("Delete from Hotelfang where ParentID = " & nID)

            Dim Tn ,ii
            ii = oUpload.Form("Acount") - 1       
   
            For Tn = 1 To ii
           
    If oUpload.Form("txtAnswer_"&Tn) <> "" Then
               
    Set oRs = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * From Hotelfang Where ID=0"               
    oRs.ActiveConnection = ConnectionString
    oRs.Source = sSQL
    oRs.CursorType = 1
    oRs.CursorLocation = 2
    oRs.LockType = 3
    oRs.Open
    oRs.AddNew()
   
    oRs("ParentID") = nID
    oRs("Answer") = oUpload.Form("txtAnswer_"&Tn&"")
    oRs("price_can") = oUpload.Form("price_can_"&Tn&"")
    oRs("price_te") = oUpload.Form("price_te_"&Tn&"")
    oRs("content") = oUpload.Form("content_"&Tn&"")
   
    oRs.Update()           
    oRs.Close()   
                   
    End If       
           
            Next   
           
    set oUpload = Nothing
   
    DBConnEnd()
   
    Dim strRedirect,strSourceUrl

    strRedirect="jiudian"
    'strSourceUrl=request("sourceUrl") & ""
    strSourceUrl="/jiudian/jiudian.asp?ID=" & nID'要生成的目标文件
    strFileName=strFileName
    '写入到文件
    Write2file strRedirect,strSourceUrl,strFileName
    '参数说明:strRedirect文件目录,strSourceUrl资源地址,strFileName文件名       
    'response.write strSourceUrl
    'response.end
   
    Response.Write("<script>location.href='"&nURL&"';alert('操作成功.');</script>")
    response.end
   
End If
   
If nID = 0 Then
    Name = ""
    EName = ""
    keyword = ""
2011-02-22 18:43
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
    sSQL = "Select * From Hotel Where ID=" & nID
    oRs.ActiveConnection = ConnectionString
    oRs.Source = sSQL
    oRs.CursorType = 1
    oRs.CursorLocation = 2
    oRs.LockType = 3
    oRs.Open
这段代码改为
sSQL = "Select * From Hotel Where ID=" & nID
oRs.Open sSQL,oConn,1,3
2011-02-22 21:32
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:5 
楼主一定是你们老师给你们的作业太教条化了。addnew,update的执行方式是教材上的。或者一些老代码里能见到。还有代码执行部分,现在比较少看到人这么用了。

把代码发全打包。然后把有问题的页面和代码用txt写个说明文档不就OK了吗。

发这么多代码,我们是人不是机器,用眼睛去看代码哪里错误,也只是靠感觉去判断,判断错误也是在所难免的!

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2011-02-22 22:11
tandezhong
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:31
专家分:118
注 册:2011-2-11
收藏
得分:5 
回复 4楼 天空云朵
图片附件: 游客没有浏览图片的权限,请 登录注册


把圈起来的地方  移动箭头出  试试...
2011-02-23 15:42
快速回复:困扰我3天的asp后台管理页面提交成html页面失败问题 错误类型:Micro ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038935 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved