ADODB.Recordset 错误 '800a0e7d' 连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
ADODB.Recordset 错误 '800a0e7d'连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
/Conn.asp,行 71
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'--------------------------------------------------
'--------------------------------------------------
Session.CodePage=65001
Response.codepage=65001
Response.Charset="UTF-8"
'on Error Resume Next
Response.Buffer = True
Response.expiresabsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","no-store"
'Response.Clear
'Server.ScriptTimeOut= 999999
'Session.Timeout = 30
'Dim isdata
isdata = 1
Function OpenConn()
dim conn
dim connstr
dim db,pass_word,User_ID,Data_Source
Data_Source="127.0.0.1" '请输入Sqlserver服务器的IP地址,或者数据库实例名称
DbPort="1433" '数据库连接端口号,默认为1433,一般此处不需要更改
db="26" '请输入Sqlserver服务器的数据库名称
User_ID="sa" '请输入连接Sqlserver服务器的用户名
pass_word="sa" '请输入连接Sqlserver服务器的密码
On Error Resume Next
If DbPort="1433" Then
DbPort=""
Else
DbPort=","&DbPort
End If
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=SQLOLEDB.1;Password='"&pass_word&"';"&"Persist Security Info=True;User ID='"&User_ID&"';"&"Initial Catalog='"&db&"';"&"Data Source='"&Data_Source&DbPort&"';Connect Timeout=15"
conn.Open connstr
Set OpenConn = conn
End Function
if isdata = 1 then
set conn = OpenConn()
else
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(Mdb)
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查数据库连接文件中的数据库参数设置。"
Response.End
End If
end if
Sub CloseConn(Conn) '关闭数据库代码
On Error Resume Next
If IsObject(Conn) then
Conn.Close()
Set Conn = Nothing
End If
If Err Then Err.Clear
End Sub
Set RsSet=Server.CreateObject("Adodb.RecordSet")
Sql="Select Top 1 * From Admin Order By ID"
RsSet.Open Sql,Conn,1,1//出错行
If RsSet.Eof Then
Response.Write "数据库错误"
Response.end
End If
'网站名称
WebTitle = GetSet(RsSet("SiteName"),"WebName")
'网站子标题
WebsTitle = GetSet(RsSet("SiteName"),"WebsName")
'网站域名
WebUrl = RsSet("SiteUrl")
'网站金币名称
Webjb = RsSet("Webjb")
'网站成长值名称
Webgrow = RsSet("Webgrow")
'系统安全码
SysCode = RsSet("SysKey")
'备案号
beianCode = GetSet(RsSet("SiteFooter"),"footbeian")
'备案号
tongjiCode = GetSet(RsSet("SiteFooter"),"foottongji")
'使用的模板名称
TemplateName=RsSet("TemplateName")
zxwplzb = RsSet("weblzb")
'--------------------------------
'开关
web_on = RsSet("web_on")
JifenOn = RsSet("jifentomoney")
adpagesize = RsSet("syspagesize")
UserManagePath = RsSet("UserManagePath")
'if web_on = 0 then
'response.Redirect("")
'end if
%>