DW+ASP+ACCESS问题
我已经做好一个网站但是我用软件开启WEB服务(如盟城的ASPWEB服务器)就可以正常访问,但是如果我用IIS5.1开启服务,就会提示MicrosoftOLEDBProvi...
我已经做好一个网站但是我用软件开启WEB服务(如盟城的ASPWEB服务器)就可以正常访问,但是如果我用IIS5.1开启服务,就会提示
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
[Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0xff4 Thread 0xc28 DBC 0x16c2024 Jet'。
/index.asp,行 5
下面是我的index.asp的代码
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include virtual="/Connections/conn.asp" -->
<%
var denglu = Server.CreateObject("ADODB.Recordset");
denglu.ActiveConnection = MM_conn_STRING;
denglu.Source = "SELECT * FROM denglu";
denglu.CursorType = 0;
denglu.CursorLocation = 2;
denglu.LockType = 1;
denglu.Open();
var denglu_numRows = 0;
%>
<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername=String(Request.Form("user"));
if (MM_valUsername != "undefined") {
var MM_fldUserAuthorization="quanxian";
var MM_redirectLoginSuccess="login.asp";
var MM_redirectLoginFailed="quit.asp";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_conn_STRING;
MM_rsUser.Source = "SELECT user, pws";
if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM denglu WHERE user='" + MM_valUsername.replace(/'/g, "''") + "' AND pws='" + String(Request.Form("pws")).replace(/'/g, "''") + "'";
MM_rsUser.CursorType = 0;
MM_rsUser.CursorLocation = 2;
MM_rsUser.LockType = 3;
MM_rsUser.Open();
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username") = MM_valUsername;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
} else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}
%>
<!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>
<style type="text/css">
<!--
.STYLE1 {font-size: 18px}
-->
</style>
</head>
<body>
<table width="1057" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr> 展开
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
[Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0xff4 Thread 0xc28 DBC 0x16c2024 Jet'。
/index.asp,行 5
下面是我的index.asp的代码
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include virtual="/Connections/conn.asp" -->
<%
var denglu = Server.CreateObject("ADODB.Recordset");
denglu.ActiveConnection = MM_conn_STRING;
denglu.Source = "SELECT * FROM denglu";
denglu.CursorType = 0;
denglu.CursorLocation = 2;
denglu.LockType = 1;
denglu.Open();
var denglu_numRows = 0;
%>
<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername=String(Request.Form("user"));
if (MM_valUsername != "undefined") {
var MM_fldUserAuthorization="quanxian";
var MM_redirectLoginSuccess="login.asp";
var MM_redirectLoginFailed="quit.asp";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_conn_STRING;
MM_rsUser.Source = "SELECT user, pws";
if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM denglu WHERE user='" + MM_valUsername.replace(/'/g, "''") + "' AND pws='" + String(Request.Form("pws")).replace(/'/g, "''") + "'";
MM_rsUser.CursorType = 0;
MM_rsUser.CursorLocation = 2;
MM_rsUser.LockType = 3;
MM_rsUser.Open();
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username") = MM_valUsername;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
} else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}
%>
<!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>
<style type="text/css">
<!--
.STYLE1 {font-size: 18px}
-->
</style>
</head>
<body>
<table width="1057" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr> 展开
展开全部
经过网上查询说是两个原因
1。微软已经不更新ODBC,需要改用JET的方式连接ACCESS数据库文件;
2。系统目录的权限发生的变更。
解决方式如下:
1、如果自己有操作服务器的权限:
在自己的2003服务器上测试,把windows\temp目录增加everyone用户读写权限,然后再重启计算机可以解决故障。
2、自己没有服务器操作权限:
经过多次测试,原联接
<%
set conn = Server.CreateObject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("xxx.mdb")
%>
修改为
<% dim conn
dim connstr
set conn = Server.CreateObject("ADODB.Connection")
connstr="provider=microsoft.jet.oledb.4.0;data source=" &server.mappath ("xxx.mdb")
'connstr="DBQ="+server.mappath("../data/jf.asa") +";provider=microsoft.jet.oledb.4.0;"
conn.open connstr
%>
测试成功!!
其实还有一种可能,就是你的系统权限不够
解决办法,设置 WINDOWS目录下TEMP文件夹的权限,在TEMP点右键,选择属性,打开安全选项,添加Internet 来宾帐户权限设置为完全控制
1。微软已经不更新ODBC,需要改用JET的方式连接ACCESS数据库文件;
2。系统目录的权限发生的变更。
解决方式如下:
1、如果自己有操作服务器的权限:
在自己的2003服务器上测试,把windows\temp目录增加everyone用户读写权限,然后再重启计算机可以解决故障。
2、自己没有服务器操作权限:
经过多次测试,原联接
<%
set conn = Server.CreateObject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("xxx.mdb")
%>
修改为
<% dim conn
dim connstr
set conn = Server.CreateObject("ADODB.Connection")
connstr="provider=microsoft.jet.oledb.4.0;data source=" &server.mappath ("xxx.mdb")
'connstr="DBQ="+server.mappath("../data/jf.asa") +";provider=microsoft.jet.oledb.4.0;"
conn.open connstr
%>
测试成功!!
其实还有一种可能,就是你的系统权限不够
解决办法,设置 WINDOWS目录下TEMP文件夹的权限,在TEMP点右键,选择属性,打开安全选项,添加Internet 来宾帐户权限设置为完全控制
追问
非常感谢你,上面的问题已经解决了。现在又出现个信的问题。我打开页面后登陆然后就提示
Provider 错误 '80004005'
未指定的错误
/index.asp,行 5
追答
百度搜索:Provider 错误 '80004005' 未指定的错误
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询