Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
不知道什么问题,网站出现这种情况由于我不是很懂,希望哪位大侠能说明一下需要改什么地方,怎么改,或者把那段代码帮忙改一下
代码贴出来,希望能找到个答案
<%@ LANGUAGE = VBScript CodePage = 936%>
<%Server.ScriptTimeOut=72000%>
<!--#include file="sqlin.asp"-->
<!--#include file="config.asp"-->
<%
Response.Buffer = True
randomize timer
Dim db,verStr
Dim SqlNowString,Conn
dim Rs,Rs1,Rs2
dim mssql
'安全码与版本鉴别码/////////////////////////////////////////////////
adminPass="654321"
regName="cqruan"
'///////////////////////////////////////////////////////////////////
'当前支持游戏///////////////////////////////////////////////////////
AllGames="热血传奇|传奇世界|征途"
'///////////////////////////////////////////////////////////////////
Sub ConnectionDatabase
Dim ConnStr
connstr="driver={SQL Server};server="&sqlip&";uid="&sqluid&";pwd="&sqlpwd&";database="&sqlname&""
'On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "The Sever Is Busy,Please try again..."
Response.End
End If
End Sub
Function GrateRs(SqlStr,wr)
dim Rs
Set Rs=Server.CreateObject("ADODB.Recordset")
Rs.Open SqlStr, Conn, 1, wr
set GrateRs=Rs
End Function
Function ReplStr(s)
s=Replace(s,"'","’")
s=Replace(s,"%","%")
s=Replace(s,"&","&")
s=Replace(s,"<","<")
s=Replace(s,">",">")
s=replace(s,chr(13)+chr(10),"<br>")
s=Replace(s," "," ")
ReplStr=s
End Function
'防SQL注入函数
Function YeSqlStr(data,falgs)
select case falgs
case "1" '数值型
data= data
if not isNumeric (data) then data=0
case "2" '字符型
data = Replace (data, "'", "''" )
case else '字符串
data = Trim(Replace(data, "&", "&"))
data = replace(data, "<", "<")
data = replace(data, ">", ">")
data = replace(data, "'", """")
data = replace(data, "*", "")
data = replace(data, "?", "")
data = replace(data, "select", "")
data = replace(data, "insert", "")
data = replace(data, "delete", "")
data = replace(data, "update", "")
data = replace(data, "delete", "")
data = replace(data, "create", "")
data = replace(data, "drop", "")
data = replace(data, "declare", "")
data = replace(data, vbCrLf&vbCrlf, "</p><p>")
data = replace(data, vbCrLf, "<br>")
end select
YeSqlStr= data
End Function
Sub DBConnEnd()
On Error Resume Next
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
End Sub
sub AdShow(content)
Set adRs=GrateRs("select * from H_ads where adid=1",1)
if content=1 then
response.write adRs("qq")
elseif content=2 then
response.write adRs("xieyi")
else
response.write adRs("liucheng")
end if
adRs.close
set adRs=nothing
end sub
Sub payoption(x)
Dim Rs
Response.Write "<option value=''>全部</option>"
set Rs=GrateRs("select id,Pname from H_plist",2)
do while not Rs.eof
Response.Write "<option value='"&Rs("id")&"'"
If Rs("id")=x Then Response.Write " selected "
Response.Write ">"&Rs("Pname")&"</option>"
Rs.movenext
loop
End sub
function zero(num)
if left(num,1)="." and IsNumeric(right(num,1)) then
zero="0"&Num
else
zero=num
end if
end function
%>