为什么?谁能在这里给我改一下
[bo]这个程序总是提示“系统正在维护,请稍后再试”。哪位高手能给我改一下在这里面,谢谢了!![/bo]<%
'Option Explicit
Response.Buffer = True
'全局变量
Dim showye,page
Dim SqlNowString
Dim SqlBoolStringTrue
Dim SqlBoolStringFalse
Dim Startime
Dim Conn
'定义数据库类别,1为SQL数据库,0为Access数据库
Const CityAdminCSS="<link rel=""stylesheet"" type=""text/css"" href=""/CSS/main.css"">"
Const IsSqlDataBase = 1
'定义运行模式,测试的时候设置1,正常运行的时候设置为0,不输出错误信息有利于安全,
'========================================================
'程序调试开关,为true 输出错误提示,为false 不输出错误提示
'========================================================
Const IsDeBug = 0
Startime = Timer()
'SQL获取时间函数
If IsSqlDataBase = 1 Then
SqlNowString = "GetDate()"
SqlBoolStringTrue="1"
SqlBoolStringFalse="0"
Else
SqlNowString = "Now()"
SqlBoolStringTrue="true"
SqlBoolStringFalse="false"
End If
function SqlBoolString(AValue)
select case CBool(AValue)
case True
SqlBoolString= SqlBoolStringTrue
case False
SqlBoolString= SqlBoolStringFalse
end select
end function
'打开数据库
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
Sub ConnectionDatabase
Dim ConnStr
If IsSqlDataBase = 1 Then
'sql数据库连接参数:数据库名、用户密码、用户名、连接名(本地用local,外地用IP)
SqlDatabaseName = "BIZAD"
SqlPassword = "sa"
SqlUsername = "sa"
SqlLocalName = "123"
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Else
'免费用户第一次使用请修改本处数据库地址并相应修改data目录中数据库名称,如将.mdb修改为.asp DB=Server.MapPath(DB)
'ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &Server.MapPath(db)
Connstr="DBQ="+Db+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
'Connstr="DBQ="+Server.Mappath(Db)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
'如果你的服务器采用较老版本Access驱动,请用下面连接方法
'ConnStr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(db)
End If
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
debugError("ERR001")
Err.Clear
Set Conn = Nothing
Response.End
End If
End Sub
'打开数据链接
If Not IsObject(Conn) Then ConnectionDatabase
dim rs:set rs =server.createobject("adodb.recordset")
'========================================================
'输出错误提示
'当IsDeBug为true时,在打开数据库发生错误时会输入错误
'提示,否则不输入错误提示,建议在程序调试时打开,调试完后
'关闭该功能,
'========================================================
sub debugError(strErrCode)
if IsDeBug = 1 then
for i = 0 to conn.errors.count-1
response.write "数据库连接出错,请检查连接字串<br>"
response.write "<font style='font-size:10.5pt'><font color=red><b>Error Number: </b></font>" & conn.errors(i).number & "<br>"
response.write "<font color=red><b>Error NativeError: </b></font>" & conn.errors(i).nativeerror & "<br>"
response.write "<font color=red><b>Error Source: </b></font>" & conn.errors(i).source & "<br>"
response.write "<font color=red><b>Error Description: </b></font>" & conn.errors(i).description & "<br>"
response.write "<!--Error Sql Code:" & strErrCode & "-->"
next
else
response.write "正在系统维护,请稍后再试。<br>"
response.write
response.end
end if
if conn.errors.count>0 then
conn.errors.clear
set conn=nothing
'结束执行
response.end
end if
end sub
function depclassidconvert(theid)
If IsSqlDataBase = 1 Then
depclassidconvert=theid
else
depclassidconvert="'"&theid&"'"
end if
end function
'关闭数据库连接
sub closedatabase
Conn.close
set Conn = Nothing
end sub
sub SortMenuInsearch
dim rs2,sql2
set rs2=server.createobject("adodb.recordset")
sql2="select * from Class_1"
rs2.open sql2,conn,1,1
if rs2.eof and rs2.bof then
response.write "<option value='没有类别'>没有类别</option>"
else
response.write "<option value='0'>所有类别</option>"&vbcrlf
do while not rs2.eof
response.write "<option value='"&rs2("SortID")&"'"
if request("SortID")<>"" then
if rs2("SortID")=clng(request("SortID")) then response.write " selected "
end if
response.write ">"&rs2("Sort")&"</option>"&vbcrlf
rs2.movenext
loop
end if
rs2.close
set rs2=nothing
end sub
sub scripterr
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n"&errstyle&"');history.go(-1);</script>"
response.end
end sub
%>
<!--#include file="./functions.asp"-->
<!--#include file="./adovbs.inc.asp"-->
<!--#include file="./configinfo.asp"-->
<%
dim ConfigInfo
set ConfigInfo=new GetConfigInfo_Class
ConfigInfo.load
%>
<%'...%>
[[it] 本帖最后由 tiankong118 于 2008-9-15 09:53 编辑 [/it]]