标题:Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
取消只看楼主
QQ80858582
Rank: 1
等 级:新手上路
帖 子:13
专家分:2
注 册:2010-4-14
结帖率:50%
 问题点数:0 回复次数:1 
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,"<","&lt;")
    s=Replace(s,">","&gt;")
    s=replace(s,chr(13)+chr(10),"<br>")
    s=Replace(s," ","&nbsp;")
    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, "&", "&amp;"))
    data = replace(data, "<", "&lt;")
    data = replace(data, ">", "&gt;")
    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


%>
搜索更多相关主题的帖子: Microsoft OLE ODBC Drivers Provider 
2010-09-21 17:20
QQ80858582
Rank: 1
等 级:新手上路
帖 子:13
专家分:2
注 册:2010-4-14
得分:0 
楼上的大哥,有什么办法修改这个吗。我用的是虚拟主机
2010-09-21 22:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-321069-1-1.html




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

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