| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2373 人关注过本帖
标题:Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
只看楼主 加入收藏
QQ80858582
Rank: 1
等 级:新手上路
帖 子:13
专家分:2
注 册:2010-4-14
结帖率:50%
收藏
 问题点数:0 回复次数:3 
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
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
connstr="driver={SQL Server};server="&sqlip&";uid="&sqluid&";pwd="&sqlpwd&";database="&sqlname&""
连接字符串服务器不支持更换连接字符串
2010-09-21 19:57
QQ80858582
Rank: 1
等 级:新手上路
帖 子:13
专家分:2
注 册:2010-4-14
收藏
得分:0 
楼上的大哥,有什么办法修改这个吗。我用的是虚拟主机
2010-09-21 22:59
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:0 
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
在上面那段你的代码里,把H_ads表外面加[],如下:
Set adRs=GrateRs("select * from [H_ads] where adid=1",1)
多试几种方法总有一中合适你的!

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-09-22 00:18
快速回复:Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
数据加载中...
 
   



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

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