ADODB.Recordset 错误 '800a0e7d' 请帮忙解决!

xclixm 2011-08-09 04:57:30
我的网站后台管理程序,在本机127.0.0.1调试正常,传到服务器上添加修改文章时出现:

ADODB.Recordset 错误 '800a0e7d'

连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。

/WebEditor/ewebeditor.asp,行 211

以下是ewebeditor.asp原程序,各位前辈高手帮忙指点一下什么原因。

<!--#include file = "Include/Startup.asp"-->

<%
' 初始输入参数
Dim sContentID, sStyleID, sFullScreen
Dim sStyleName, sStyleDir, sStyleCSS, sStyleUploadDir, nStateFlag, sDetectFromWord, sInitMode, sBaseUrl, sBaseHref, sAutoRemote, sShowBorder
Dim sVersion, sReleaseDate, sLicense

Dim aButtonCode(), aButtonHTML()
Dim s*, s*Normal, s*FullScreen

' 初始化
Call Init()

%>


<html>
<head>
<title>在线编辑器 - 网页对话框</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Css/Editor.css" type="text/css" rel="stylesheet">

<Script Language=Javascript>
var sPath = document.location.pathname;
sPath = sPath.substr(0, sPath.length-14);

var sLinkFieldName = "<%=sContentID%>" ;
var sLinkOriginalFileName = "<%=Request.QueryString("originalfilename")%>" ;
var sLinkSaveFileName = "<%=Request.QueryString("savefilename")%>" ;
var sLinkSavePathFileName = "<%=Request.QueryString("savepathfilename")%>" ;

// 全局设置对象
var config = new Object() ;
config.Version = "<%=sVersion%>" ;
config.ReleaseDate = "<%=sReleaseDate%>" ;
config.License = "<%=sLicense%>" ;
config.StyleName = "<%=sStyleName%>";
config.StyleMenuHeader = "<head><link href=\""+sPath+"Css/MenuArea.css\" type=\"text/css\" rel=\"stylesheet\"></head><body scroll=\"no\" onConTextMenu=\"event.returnValue=false;\">";
config.StyleDir = "<%=sStyleDir%>";
config.StyleUploadDir = "<%=sStyleUploadDir%>";
config.InitMode = "<%=sInitMode%>";
config.AutoDetectPasteFromWord = <%=sDetectFromWord%>;
config.BaseUrl = "<%=sBaseUrl%>";
config.BaseHref = "<%=sBaseHref%>";
config.AutoRemote = "<%=sAutoRemote%>";
config.ShowBorder = "<%=sShowBorder%>";

var sBaseHref = "";
if(config.BaseHref!=""){
sBaseHref = "<base href=\"" + document.location.protocol + "//" + document.location.host + config.BaseHref + "\">";
}
config.StyleEditorHeader = "<head><link href=\"" + sPath + "Css/EditorArea.css\" type=\"text/css\" rel=\"stylesheet\">" + sBaseHref + "</head><body MONOSPACE>" ;
</Script>
<Script Language=Javascript src="include/editor.js"></Script>
<Script Language=Javascript src="include/table.js"></Script>
<Script Language=Javascript src="include/menu.js"></Script>

<script language="javascript" event="onerror(msg, url, line)" for="window">
return true ; // 隐藏错误
</script>

</head>

<body SCROLLING=no onConTextMenu="event.returnValue=false;">

<table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
<tr><td>

<%=s*%>

</td></tr>
<tr><td height='100%'>

<table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
<tr><td height='100%'>
<input type="hidden" ID="ContentEdit" value="">
<input type="hidden" ID="ModeEdit" value="">
<input type="hidden" ID="ContentLoad" value="">
<input type="hidden" ID="ContentFlag" value="0">
<iframe class="Composition" ID="eWebEditor" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="100%" scrolling="yes">
</iframe>
</td></tr>
</table>

</td></tr>

<% If nStateFlag = 1 Then %>
<tr><td height=25>

<TABLE border="0" cellPadding="0" cellSpacing="0" width="100%" class=StatusBar height=25>
<TR valign=middle>
<td>
<table border=0 cellpadding=0 cellspacing=0 height=20>
<tr>
<td width=10></td>
<td class=StatusBarBtnOff id=eWebEditor_CODE onClick="setMode('CODE')"><img border=0 src="SysImage/<%=sStyleDir%>/modecode.gif" width=50 height=15 align=absmiddle></td>
<td width=5></td>
<td class=StatusBarBtnOff id=eWebEditor_EDIT onClick="setMode('EDIT')"><img border=0 src="SysImage/<%=sStyleDir%>/modeedit.gif" width=50 height=15 align=absmiddle></td>
<td width=5></td>
<td class=StatusBarBtnOff id=eWebEditor_TEXT onClick="setMode('TEXT')"><img border=0 src="SysImage/<%=sStyleDir%>/modetext.gif" width=50 height=15 align=absmiddle></td>
<td width=5></td>
<td class=StatusBarBtnOff id=eWebEditor_VIEW onClick="setMode('VIEW')"><img border=0 src="SysImage/<%=sStyleDir%>/modepreview.gif" width=50 height=15 align=absmiddle></td>
</tr>
</table>
</td>
<!-- <td align=center id=eWebEditor_License style="font-size:9pt"></td> //-->
<td align=right>
<table border=0 cellpadding=0 cellspacing=0 height=20>
<tr>
<td style="cursor:pointer;" onClick="sizeChange(300)"><img border=0 SRC="SysImage/<%=sStyleDir%>/sizeplus.gif" width=20 height=20 alt="增高编辑区"></td>
<td width=5></td>
<td style="cursor:pointer;" onClick="sizeChange(-300)"><img border=0 SRC="SysImage/<%=sStyleDir%>/sizeminus.gif" width=20 height=20 alt="减小编辑区"></td>
<td width=40></td>
</tr>
</table>
</td>
</TR>
</Table>

</td></tr>
<% End If %>

</table>

<div id="eWebEditor_Temp_HTML" style="VISIBILITY: hidden; OVERFLOW: hidden; POSITION: absolute; WIDTH: 1px; HEIGHT: 1px"></div>

<form id="eWebEditor_UploadForm" action="upload.asp?type=remote&style=<%=sStyleName%>" method="post" target="eWebEditor_UploadTarget">
<input type="hidden" name="eWebEditor_UploadText">
</form>
<iframe name="eWebEditor_UploadTarget" width=0 height=0></iframe>
<!--
<div id=divProcessing style="width:200px;height:30px;position:absolute;display:none">
<table border=0 cellpadding=0 cellspacing=1 bgcolor="#000000" width="100%" height="100%"><tr><td bgcolor=#3A6EA5><marquee align="middle" behavior="alternate" scrollamount="5" style="font-size:9pt"><font color=#FFFFFF>...远程文件收集中...请等待...</font></marquee></td></tr></table>
</div>
//-->
</body>
</html>


<%


' 显示调用错误提示
Sub ShowErr(str)
Call DBConnEnd()
Response.Write "调用错误:" & str
Response.End
End Sub

' 初始化
Sub Init()
' 取全屏标志
sFullScreen = Trim(Request.QueryString("fullscreen"))
' 取对应的内容ID
sContentID = Trim(Request.QueryString("id"))
If sContentID = "" Then ShowErr "请传入调用参数ID,即隐藏的内容表单项ID!"

' 取样式初始值
sStyleName = Get_SafeStr(Trim(Request.QueryString("style")))
If sStyleName = "" Then sStyleName = "standard"

Dim s_SelfUrl, s_ApplicationName, n_Application, i
s_SelfUrl = UCase(Request.ServerVariables("SERVER_NAME") & ":" & Request.ServerVariables("SERVER_PORT") & Request.ServerVariables("SCRIPT_NAME") & "?style=" & sStyleName)
n_Application = 0

Dim aApplicationName, aApplicationUrl, aApplicationValue
aApplicationName = Application("eWebEditor_ApplicationName")
aApplicationUrl = Application("eWebEditor_ApplicationUrl")

If IsArray(aApplicationName) = True Then
n_Application = UBound(aApplicationName)

' 是否在内存中
For i = 1 To n_Application
If aApplicationUrl(i) = s_SelfUrl Then
s_ApplicationName = aApplicationName(i)
aApplicationValue = Application(s_ApplicationName)
sStyleID = aApplicationValue(0)
sStyleName = aApplicationValue(1)
sStyleDir = aApplicationValue(2)
sStyleCSS = aApplicationValue(3)
sStyleUploadDir = aApplicationValue(4)
nStateFlag = aApplicationValue(5)
sDetectFromWord = aApplicationValue(6)
sInitMode = aApplicationValue(7)
sBaseUrl = aApplicationValue(8)
sVersion = aApplicationValue(9)
sReleaseDate = aApplicationValue(10)
sLicense = aApplicationValue(11)
s*Normal = aApplicationValue(12)
s*FullScreen = aApplicationValue(13)
sBaseHref = aApplicationValue(14)
sAutoRemote = aApplicationValue(15)
sShowBorder = aApplicationValue(16)
If sFullScreen = "1" Then
s* = s*FullScreen
Else
s* = s*Normal
End If
Exit Sub
End If
Next
End If


' 初始化数据库连接
Call DBConnBegin()

sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'"
oRs.Open sSql, oConn, 0, 1 (第211行,提示这行错误)
If Not oRs.Eof Then
sStyleID = oRs("S_ID")
sStyleName = oRs("S_Name")
sStyleDir = oRs("S_Dir")
sStyleCSS = oRs("S_CSS")
sStyleUploadDir = oRs("S_UploadDir")
nStateFlag = oRs("S_StateFlag")
sAutoRemote = CStr(oRs("S_AutoRemote"))
sShowBorder = CStr(oRs("S_ShowBorder"))
sDetectFromWord = oRs("S_DetectFromWord")
sInitMode = oRs("S_InitMode")
sBaseUrl = oRs("S_BaseUrl")
sBaseHref = oRs("S_BaseHref")
Else
ShowErr "无效的样式Style参数传入,如果要使用默认值,请留空!"
End If
oRs.Close

......
...全文
379 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
xclixm 2011-08-19
  • 打赏
  • 举报
回复
是服务器的问题吧,程序在别的电脑上能正常运行。服务器应该怎样设置才行呀!
xclixm 2011-08-19
  • 打赏
  • 举报
回复
各位前辈们,你们的方法我都用了,问题依然存在。还有谁解决过这问题呀!
haikeshilan 2011-08-16
  • 打赏
  • 举报
回复
sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'"
把后面的 where s_name='" & sStyleName & "'去掉试试看
xclixm 2011-08-15
  • 打赏
  • 举报
回复
前辈们,意思是没办法解决了?
yan267 2011-08-15
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 xclixm 的回复:]
在本机上调试很正常的,传到服务器上添加文章时提示:

ADODB.Recordset 错误 '800a0e7d'

连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。

/WebEditor/ewebeditor.asp,行 211


下面是一段程序:

' 初始化数据库连接
Call DBConnBegin()

sSql = "select……
[/Quote]

ssql上面加上
set oRs=Server.CreateObject("ADODB.Recordset")
xclixm 2011-08-15
  • 打赏
  • 举报
回复
应该不是程序的问题,在本机上调试很正常的。
万载馨辰 2011-08-12
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 xclixm 的回复:]

“孟子E章”非常感谢你,我没找到 DBConnBegin 文件呀!
[/Quote]

孟子的意思是DBconnBegin这个函数的代码

楼主程序基础不够,不建议使用eweb
xclixm 2011-08-11
  • 打赏
  • 举报
回复
哪位前辈知道怎么处理?请帮忙!
xclixm 2011-08-11
  • 打赏
  • 举报
回复
多谢指导,还是不行。
xingdongfang 2011-08-11
  • 打赏
  • 举报
回复
古董级的ASP了,好些年没有看到了,看上去,比较亲切。
xclixm 2011-08-11
  • 打赏
  • 举报
回复
“孟子E章”非常感谢你,我没找到 DBConnBegin 文件呀!
万载馨辰 2011-08-11
  • 打赏
  • 举报
回复
楼主多半在看陶益的dreamweaver cs4教程了,他的教程就是用ewebeditor,这个编辑器我花了四个小时终于搞定了


打酱油路过····
孟子E章 2011-08-11
  • 打赏
  • 举报
回复
DBConnBegin的代码呢
xclixm 2011-08-11
  • 打赏
  • 举报
回复
哪位高手站长帮一下忙呀!谢谢!谢谢了!
孟子E章 2011-08-10
  • 打赏
  • 举报
回复
oConn.Open
Set rs = oConn.Execute(sSql)
xclixm 2011-08-10
  • 打赏
  • 举报
回复
有高手知道怎么解决吗?
xclixm 2011-08-09
  • 打赏
  • 举报
回复
在本机上调试很正常的,传到服务器上添加文章时提示:

ADODB.Recordset 错误 '800a0e7d'

连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。

/WebEditor/ewebeditor.asp,行 211


下面是一段程序:

' 初始化数据库连接
Call DBConnBegin()

sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'"
oRs.Open sSql, oConn, 0, 1 (第211行,提示这行错误) If Not oRs.Eof Then
sStyleID = oRs("S_ID")
sStyleName = oRs("S_Name")
sStyleDir = oRs("S_Dir")
sStyleCSS = oRs("S_CSS")
sStyleUploadDir = oRs("S_UploadDir")
nStateFlag = oRs("S_StateFlag")
sAutoRemote = CStr(oRs("S_AutoRemote"))
sShowBorder = CStr(oRs("S_ShowBorder"))
sDetectFromWord = oRs("S_DetectFromWord")
sInitMode = oRs("S_InitMode")
sBaseUrl = oRs("S_BaseUrl")
sBaseHref = oRs("S_BaseHref")
Else
子夜__ 2011-08-09
  • 打赏
  • 举报
回复
在此上下文中它可能已被关闭或无效。
应该是没有打开。
LMAOhuaNL 2011-08-09
  • 打赏
  • 举报
回复
代码太长 了,copy几段重点代码看看
孟子E章 2011-08-09
  • 打赏
  • 举报
回复
oConn打开了吗?

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧