简单的数据库问题.送分!

yanweidong1030 2003-05-30 12:59:58
请问:
我写一个显示记录的程序,一开始显示很正常。可是多刷新几次就会出现以下在的错误:
——————————————————————
Provider 错误 '80004005'

未指定的错误

/web/include/conn.asp,行5

——————————————————————
在等一会刷新!就又好了。

请大家帮帮我。

我的数据库用的是ACCESS。
...全文
23 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
chichuli_4 2003-05-30
  • 打赏
  • 举报
回复
conn.close
set conn=nothing
fcuandy 2003-05-30
  • 打赏
  • 举报
回复
试试

<%
dim conn,connstr
connstr="DBQ="&server.mappath("include/article.mdb")&";DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
wang7655 2003-05-30
  • 打赏
  • 举报
回复
添加在最后面!

释放你用的对象!
bullion 2003-05-30
  • 打赏
  • 举报
回复
最好添加在最后面
hubinasm 2003-05-30
  • 打赏
  • 举报
回复
加在调用的最后呀。
你要释放对象的。
huanghai2000 2003-05-30
  • 打赏
  • 举报
回复
主要是对象刷新过快!我建议你使用SQL数据库
yanweidong1030 2003-05-30
  • 打赏
  • 举报
回复
conn.close
set conn=nothing

这句话加在那里?
yanweidong1030 2003-05-30
  • 打赏
  • 举报
回复
-------------------end.asp--------------------
<table width="770" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="bk">
<!--DWLayoutTable-->
<tr>
<td width="6" height="15"></td>
<td width="343" valign="top"><font size="2"><strong><img src="IMAGES/Img_02.gif" width="5" height="9">
相关文章 </strong> </font> </td>
<td width="18"></td>
<td width="30"></td>
<td width="343" valign="top"><font size="2"><strong><img src="IMAGES/Img_02.gif" width="5" height="9">
论坛热点</strong></font></td>
<td width="25"></td>
<td width="3"></td>
</tr>
<tr>
<td height="74"></td>
<td colspan="2" valign="top">
<%
MAIN_TYPE=rs("MAIN_TYPE")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from main where MAIN_TYPE='"&MAIN_TYPE&"'"
rs.open sql,conn,1,3
for i=1 to 5
if not rs.eof then
%>
<a href="display.asp?id=<%=rs("MAIN_ID")%>" target="_blank" ><%=rs("MAIN_DATE")%>
<%=rs("MAIN_TITLE")%> <br>
</a><%
rs.movenext
end if
i=i+1
next
%>
</td>
<td> </td>
<td colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td> </td>
</tr>
<tr class="bk1">
<td height="20" colspan="7"><div align="center"><font color="#393f59" size="2">©CopyRight
2002-2003, CNITADMIN.COM®, Inc. All Rights Reserved </font></div></td>
</tr>
</table>
<%rs.close%>
yuhf 2003-05-30
  • 打赏
  • 举报
回复
access数据库链接未释放造成的,mssql不会出这样的错误!检查
conn.close
set conn=nothing
是否添加
yanweidong1030 2003-05-30
  • 打赏
  • 举报
回复
-------------------Conn.asp--------------------
<%
dim conn,connstr
connstr="DBQ="+server.mappath("include/article.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>

-------------------display.asp--------------------
<!--#include file="head.asp"-->
<!--#include file="include/conn.asp"-->
<%
id=request("id")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from main where MAIN_ID="&id
rs.open sql,conn,1,3
%>
.
.
.
.
<table width="770" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="bk">
<!--DWLayoutTable-->
<tr>
<td width="10" height="3"></td>
<td width="750"></td>
<td width="5"></td>
<td width="3"></td>
</tr>
<tr>
<td height="18" colspan="3" valign="top" bgcolor="#e4e5e8"><img src="images/img_03.gif" name="Image6" width="12" height="9" id="Image6"><font size="2"> </font><span class="t1"><font color="#000033"><a href="index.html">网管之家</a>--<%=rs("MAIN_TYPE")%></font></span></td>
<td></td>
</tr>
<tr>
<td height="5"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="68" colspan="3" align="center" valign="middle"><font color="#333366" size="2"><strong><%=rs("MAIN_TITlE")%></strong></font><font color="#333366" size="3"><br>
-------------------------------------------------------------------------------------------------------------<br>
<font size="2"><%=rs("MAIN_DATE")%>     ·<%=rs("MAIN_AUTHOR")%></font></font></td>
<td></td>
</tr>
<tr>
<td height="50"> </td>
<td valign="top"><%=rs("MAIN_CONTENT")%></td>
<td> </td>
<td></td>
</tr>
<tr>
<td height="49" colspan="3" align="center" valign="top"><div align="right">---------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<font color="#006633" size="2"><img src="images/button_detail_f2.gif" width="19" height="15">
<a href="Send.asp?id=<%=rs("MAIN_ID")%>">发给好友</a>  <img src="images/button_subscribe_f2.gif" width="19" height="15">
打印本文  <img src="images/button_smile_f2.gif" width="19" height="15">
本文讨论    </font></div></td>
<td></td>
</tr>
<tr>
<td height="11"></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<!--#include file="end.asp"-->
</body>
</html>
chichuli_4 2003-05-30
  • 打赏
  • 举报
回复
conn.asp,行5
数据库连接错误
dreamfly8848 2003-05-30
  • 打赏
  • 举报
回复
把代码贴出来看看
mrjohny 2003-05-30
  • 打赏
  • 举报
回复
现象
A Microsoft OLE DB Provider for ODBC Drivers error - '80004005' Microsoft[ODBC Microsoft SQL Driver] Logon Failed() - occurs on a page with a recordset when the page is viewed through a browser or in Live Data mode.


理由
This error is generated by SQL server if it does not accept or recognize the logon account and/or password being submitted (if using Standard security) or if there is no Windows NT account to SQL account mapping (when using Integrated security).

解决方法
There are several things that may cause this ODBC error. Many of the possible reasons are listed in the table below.
If you are using standard security, the account name and password are incorrect. Try the system Admin account and password (UID= "SA" and NULL password). These must be defined on the connection string line.
DSN's do not store user names and passwords.

If you are using integrated security, check the Windows NT account that is calling the page, and find out what account (if any) it is mapped to.

SQL Server does not allow an underscore in a SQL account name.
If someone manually mapped the Windows NT IUSR_machinename account to a SQL account of the same name, it fails.
Map any account that uses an underscore to an account name on SQL that does not use the underscore.


Reker熊 2003-05-30
  • 打赏
  • 举报
回复
可能是刷新太快對象內存來不及釋放造成衝突
muxinpp 2003-05-30
  • 打赏
  • 举报
回复
一搬来说,数据库坏了
fcuandy 2003-05-30
  • 打赏
  • 举报
回复
贴吧
960379 2003-05-30
  • 打赏
  • 举报
回复
代码都没有

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧