请教一个错误的解决方法

moplusplus 2008-02-20 10:12:15
我在运行asp网页是,浏览器报错如下:

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 不能使用 '(未知的)';文件已在使用中。
/myweb/login.asp, 第 8 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

网页:
GET /myweb/login.asp

请问该如何解决?
...全文
62 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
moplusplus 2008-02-20
  • 打赏
  • 举报
回复
是否asp页面与access绑定也算打开数据库?
moplusplus 2008-02-20
  • 打赏
  • 举报
回复
为了方便分析,附上asp页面代码:

我确实关闭数据库了 只是将页面与数据库绑定了啊
另外,请教3楼的,如何将access设置成共享?是否将数据库文件设置就行了?

附asp页面代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/lianj.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_lianj_STRING
Recordset1.Source = "SELECT * FROM admin"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("textfield"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="aa.asp"
MM_redirectLoginFailed="login.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_lianj_STRING
MM_rsUser.Source = "SELECT id, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM admin WHERE id='" & Replace(MM_valUsername,"'","''") &"' AND password='" & Replace(Request.Form("textfield2"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
<table width="765" border="1" onclick="MM_validateForm('textfield','','R','textfield2','','R');return document.MM_returnValue">
<tr>
<td width="154">帐号:</td>
<td width="595"><label>
<input type="text" name="textfield" />
</label></td>
</tr>
<tr>
<td>密码:</td>
<td><label>
<input type="password" name="textfield2" />
</label></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<label>
<input type="submit" name="Submit" value="登录" />
<input type="reset" name="Submit2" value="重置" />
</label>
</div></td>
</tr>
</table>
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
moplusplus 2008-02-20
  • 打赏
  • 举报
回复
我数据库关了啊
另外 请2楼的高手说的具体点
braveboy 2008-02-20
  • 打赏
  • 举报
回复
“不能使用 '(未知的)';文件已在使用中”这个说的很清楚了。。。。。。。
littlelam 2008-02-20
  • 打赏
  • 举报
回复
是不是打开了access数据库,关闭看看
kenning 2008-02-20
  • 打赏
  • 举报
回复
晕了!这都不明白哪!楼上说的很清楚了,是说是不是用OFFICE 里的ACCESS打开了你的数据库文件
wpjwll 2008-02-20
  • 打赏
  • 举报
回复
是你打开了access数据库中相应的表!

28,390

社区成员

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

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