标题:传到空间数据库连接出错,本地测试正常。不知道什么地方错误,求解
只看楼主
QQ80858582
Rank: 1
等 级:新手上路
帖 子:13
专家分:2
注 册:2010-4-14
结帖率:50%
已结贴  问题点数:10 回复次数:4 
传到空间数据库连接出错,本地测试正常。不知道什么地方错误,求解
<%
On Error Resume Next
Dim Startime
Dim SqlNowString
Dim Conn,Db,MyDbPath,IsSqlDataBase
'========================定义数据库类别,1为SQL数据库,0为Access数据库=============================
IsSqlDataBase = "0"
MyDbPath = ""
if IsSqlDataBase = 1 Then
SqlNowString = "GetDate()"
Else
'========================Access数据库设置==========================================================
Db = "/datas/#bsbst.mdb"
SqlNowString = "Now()"
End If

    Dim ConnStr
    If IsSqlDataBase = 1 Then
        ConnStr = "Provider = Sqloledb; User ID =sa; Password =opq33music; Initial Catalog =DJSOMD; Data Source =localhost;"
    Else
        ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & db)
    End If
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open ConnStr
    If Err Then
        err.Clear
        Set Conn = Nothing
        Response.Write "数据连接出错,请检查数据连接!"
        Response.End
    End If
'----------------------------------- SEO程序 ------------------------------
Sugagent = Request.servervariables("http_user_agent")
Sugagent = Lcase(Trim(Sugagent))
If Instr(Sugagent,"baidu")>0 Then wwwseo = 1
If Instr(Sugagent,"google")>0 Then wwwseo = 1
If Instr(Sugagent,"alexa")>0 Then wwwseo = 1
If Instr(Sugagent,"yahoo")>0 Then wwwseo = 1
If Instr(Sugagent,"sohu")>0 Then wwwseo = 1
If Instr(Sugagent,"msn")>0 Then wwwseo = 1
If Instr(Sugagent,"sogou")>0 Then wwwseo = 1
If Instr(Sugagent,"3721")>0 Then wwwseo = 1
If Instr(Sugagent,"youdao")>0 Then wwwseo = 1
If Instr(Sugagent,"zhongguosou")>0 Then wwwseo = 1
If Instr(Sugagent,"live")>0 Then wwwseo = 1
'----------------------------------- SEO程序 ------------------------------
%>


我用的是ACC数据库,哪位高手能帮忙解答一下?谢谢了哈
搜索更多相关主题的帖子: 空间 数据库 求解 
2010-04-26 10:17
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
得分:3 
'========================Access数据库设 置==========================================================
Db = "/datas/#bsbst.mdb"
SqlNowString = "Now()"
End If
中的!
Db = "/datas/#bsbst.mdb"改为Db = "datas/#bsbst.mdb"试试!

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-04-26 12:33
QQ80858582
Rank: 1
等 级:新手上路
帖 子:13
专家分:2
注 册:2010-4-14
得分:0 
还是不行。
2010-04-26 13:12
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:3 
On Error Resume Next
把这句话删了看看出什么错误,把报错页面的内容贴上来。
2010-04-26 15:30
zzy_420
Rank: 4
等 级:业余侠客
威 望:2
帖 子:78
专家分:217
注 册:2009-3-26
得分:3 
Db = server.mappath("/datas/#bsbst.mdb")
2010-04-27 10:27



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




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

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