求救 ASP服务器数据库连接

pander2008 2010-07-05 03:16:22
Microsoft OLE DB Provider for ODBC Drivers '80004005'

[Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
小弟我用的是梦想家ASP测试服务器
以上报错是首页连接时(此时牵涉到数据库连接)

...全文
66 点赞 收藏 14
写回复
14 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
pander2008 2010-07-05
刚才改的就是dbconn.asp的代码
回复
pander2008 2010-07-05
已经跳转到下个asp,所以上一问题已解决,但新问题
Set hot_rs=dbconn.execute("select top 10 id,doctitle,clicknum from book where Colname <> 'qwzj' order by clicknum desc")
运行时说
缺少对象: 'dbconn'
回复
pander2008 2010-07-05
不行,报Microsoft VBScript 运行时错误 '800a01a8'
缺少对象: 'dbconn'

\www\Hot_Click.asp, line 13

错误
回复
ywfsoft 2010-07-05

connstr="provider=sqloledb;user id=sa; password=sa;database=buyercncn; data source=."
set conn = server.createobject("ADODB.connection")
conn.open connstr
回复
pander2008 2010-07-05
Params = "Provider=SQLOLEDB.1"
Params = Params & ";Data Source=" & "127.0.0.1"
Params = Params & ";User ID=" & "s467245db0"
Params = Params & ";Password=" & "338986u6"
Params = Params & ";Initial Catalog=" &"s467245db0"
Set dbConn= Server.CreateObject("ADODB.Connection")
dbConn.Open Params
公司源码。
connstr="provider=sqloledb;user id=sa; password=sa;database=buyercncn; data

source=127.0.0.1"
set conn = server.createobject("ADODB.connection")

conn.open
下载下后调试修改连接(因sql2000数据库添加了该测试程序的数据库)
回复
firstboy 2010-07-05
请使用标准连接程序。
回复
zjehero 2010-07-05
这个问题有点难度哟
回复
pander2008 2010-07-05
connstr="provider=sqloledb;user id=sa; password=sa;database=buyercncn; data

source=127.0.0.1"
set conn = server.createobject("ADODB.connection")

conn.open

有问题,调试前
Params = "Provider=SQLOLEDB.1"
Params = Params & ";Data Source=" & "127.0.0.1"
Params = Params & ";User ID=" & "s467245db0"
Params = Params & ";Password=" & "338986u6"
Params = Params & ";Initial Catalog=" &"s467245db0"
Set dbConn= Server.CreateObject("ADODB.Connection")
dbConn.Open Params
回复
pander2008 2010-07-05
该数据库用户名sa密码sa
回复
pander2008 2010-07-05
我用sqlserver2000连接了该数据库
回复
pander2008 2010-07-05
buyercncn是项目所需数据库
回复
猜我是几娃 2010-07-05
数据库都配置好了吗? 数据库中有 buyercncn 这个数据库吗?
回复
pander2008 2010-07-05
<%
connstr="provider=sqloledb;user id=sa; password=sa;database=buyercncn; data

source=127.0.0.1"
set conn = server.createobject("ADODB.connection")

conn.open
Myself = Request.ServerVariables("PATH_INFO")
Function CheckStr(c_str)
c_str=trim(c_str)
If Isnull(c_str) Then
CheckStr = ""
Exit Function
End If
c_str = Replace(c_str,Chr(0),"")
c_str = replace(c_str,CHR(39), "'")
c_str = replace(c_str,chr(34),""")
c_str = replace(replace(c_str,"<","<"),">",">")
c_str = Replace(c_str,Chr(13),"<br>")
c_str = Replace(c_str, """", "“")
Key_BadWord="SCRIPT|SCRIPT,OBJECT|OBJECT,APPLET|APPLE

T,SELECT|SELECT,EXE|EXEC,JOIN|JOIN,UNIO|UNION,WHERE|WHER

E,INSERT|INSERT,DELETE|DELETE,UPDATE|UPDATE,LIKE|LIK

E,DROP|DROP,CREATE|CREATE,RENAME|RENAME,COUNT|COUNT,CHR|C

HR,MID|MID,TRUNCATE|TRUNCATE,NCHAR|NCHAR,CHAR|CHAR,ALTER|A

LTER,CAST|CAST,EXISTS|EXISTS,XP_|XP_,SHELL|SHELL"
for each Key_one in split(Key_BadWord,",")
Key_one_1=left(Key_one,instr(Key_One,"|")-1)
Key_one_2=mid(Key_one,instr(Key_One,"|")+1)
c_str=Replace(c_str,Key_one_1,Key_one_2,1,-1,1)
next
CheckStr=c_str
End Function
Price_Cell="价格单位,平方米,米,个,套,斤,公斤,克,吨"

function to_html(a1)
a1=trim(a1)

If Isnull(a1) Then
to_html = ""
Exit Function
End If
a1=lcase(a1)
a1=replace(a1,"[h]","<a href=")
a1=replace(a1,"[/h]"," target=_blank><font color=blue><b>")
a1=replace(a1,"[/a]","</b></font></a>")
a1=replace(a1,"[c]","<center>")
a1=replace(a1,"[/c]","</center>")
a1=replace(a1,"","<b>")
a1=replace(a1,"
","</b>")
a1=replace(a1,"","<u>")
a1=replace(a1,"
","</u>")
a1=replace(a1,chr(13)&chr(10),"<br>")
to_html=a1
End function
Function un_Checkstr(Str)
Str=trim(Str)

If Isnull(Str) Then
un_Checkstr = ""
Exit Function
End If
Str = Replace(Str,"",Chr(0))

Str = replace(Str,"''","'")
Str = replace(Str,""",chr(34),1,-1,1)
Str = replace(Str, "'",CHR(39),1,-1,1)
Str = replace(replace(Str,"<","<",1,-1,1),">",">",1,-1,1)
Str = Replace(Str, "=", "=")
Str = Replace(Str,";",";")
Str = Replace(Str, "“", """")
Str = Replace(Str,"<br>",Chr(13),1,-1,1)
un_Checkstr = Replace(Str,"''","'")
End Function
sub Htm_Err(Htm_ShowWord,Htm_ShowHref,Htm_Ifend)
'信息提示!
if trim(Htm_ShowWord)<>"" then Response.write "<table

border='0' cellspacing='1' width='500' bordercolorlight='#000000'

bordercolordark='#FFFFFF' cellpadding='2' bgcolor='#000000' align='center'><tr

bgcolor='#FFFF66'><td height=100><center><b>"&Htm_ShowWord&"</td></tr></table>"
if trim(Htm_ShowHref)<>"" then
Response.write "<meta http-equiv='refresh'

content='1;url=http://www.buyercn.cn/;'>"
Response.write "<center><br><a href="&Htm_ShowHref&">[

<font color=#000000>返 回</font> ]</a>"
end if
if Htm_Ifend=1 then Response.end
end sub
function unchangechr(str)
unchangechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr

(-24159)," "),"<br>",chr(13))

'将半角双引号替换为字符"
unchangechr=replace(unchangechr,""",chr(34))

unchangechr=replace(unchangechr,"‘",chr(39))

end Function
Function ResponseCookies(Key,Value,Expires)

Response.Cookies(Key) = ""&Value&""
Response.Cookies(Key).Path = DomainPath
if int(Expires)>0 then Response.Cookies(Key).Expires = date+Expires

End Function
%>

此是那问题的具体代码
回复
猜我是几娃 2010-07-05
发链接代码来看看
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告