主题:  请教 高人

yyc2003

职务:普通成员
等级:1
金币:0.0
发贴:5
#12005/2/17 0:06:52
我用DW2004和access建立数据链接后 在DW中编辑能读取数据库中的数据。但是我F12测试就出现如下错误:
技术信息(用于支持人员)

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 磁盘或网络错误。
/mytest/cont.asp, 第 5 行

这是为什么呢 我找了找论坛的帖子还是不清楚啊!
在DW中是用MM_coontest_STRING这个变量来调用的
我用的 链接方法是:MM_coontest_STRING = "driver={Microsoft Access Driver (*.mdb)};dbq=d:\inetpub\wwwroot\mytest\databases\test.mdb"

使用决定路径 相对路径更不行。

看到有的帖子说是权限不够 我想问问 权限在哪改呢 是ACCESS的权限吗?我在里面加了everybody的权限的啊。
或者还有其他地方要改 系统temp目录的访问权限在哪更改了?问了好几个问题 望高人指点啊!

谢谢了



yyc2003

职务:普通成员
等级:1
金币:0.0
发贴:5
#22005/2/17 0:08:14
主页面的代码是:
<%@LANGUAGE="javascript" CODEPAGE="936"%>
<!--#include file="Connections/coontest.asp" -->
<%
// *** Edit Operations: declare variables

// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME";
if (Request.QueryString) {
MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}

// boolean to abort record edit
var MM_abortEdit = false;

// query string to execute
var MM_editQuery = "";
%>
<%
// *** Insert Record: set variables

if (String(Request("MM_insert") == "form1" {

var MM_editConnection = MM_coontest_STRING;
var MM_editTable = "news";
var MM_editRedirectUrl = "news.asp";
var MM_fieldsStr = "title|value|come|value|cont|value";
var MM_columnsStr = "title|',none,''|come|',none,''|cont|',none,''";

// create the MM_fields and MM_columns arrays
var MM_fields = MM_fieldsStr.split("|";
var MM_columns = MM_columnsStr.split("|";

// set the form values
for (var i=0; i+1 < MM_fields.length; i+=2) {
MM_fields[i+1] = String(Request.Form(MM_fields[i]));
}

// append the query string to the redirect URL
if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&" + Request.QueryString;
}
}
%>
<%
// *** Insert Record: construct a sql insert statement and execute it

if (String(Request("MM_insert") != "undefined" {

// create the sql insert statement
var MM_tablevalues = "", MM_dbvalues = "";
for (var i=0; i+1 < MM_fields.length; i+=2) {
var formVal = MM_fields[i+1];
var MM_typesArray = MM_columns[i+1].split(",";
var delim = (MM_typesArray[0] != "none" ? MM_typesArray[0] : "";
var altVal = (MM_typesArray[1] != "none" ? MM_typesArray[1] : "";
var emptyVal = (MM_typesArray[2] != "none" ? MM_typesArray[2] : "";
if (formVal == "" || formVal == "undefined" {
formVal = emptyVal;
} else {
if (altVal != "" {
formVal = altVal;
} else if (delim == "'" { // escape quotes
formVal = "'" + formVal.replace(/'/g,"''" + "'";
} else {
formVal = delim + formVal + delim;
}
}
MM_tablevalues += ((i != 0) ? "," : "" + MM_columns[i];
MM_dbvalues += ((i != 0) ? "," : "" + formVal;
}
MM_editQuery = "insert into " + MM_editTable + " (" + MM_tablevalues + " values (" + MM_dbvalues + "";

if (!MM_abortEdit) {
// execute the insert
var MM_editCmd = Server.CreateObject('ADODB.Command');
MM_editCmd.ActiveConnection = MM_editConnection;
MM_editCmd.CommandText = MM_editQuery;
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();

if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);
}
}

}
%>
<%
var news = Server.CreateObject("ADODB.Recordset";
news.ActiveConnection = MM_coontest_STRING;
news.Source = "SELECT * FROM news";
news.CursorType = 0;
news.CursorLocation = 2;
news.LockType = 1;
news.Open();
var news_numRows = 0;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">response.write Server.MapPath("/databases/test.mdb"</td>
</tr>
<tr>
<td height="20"><form name="form1" method="POST" action="<%=MM_editAction%>">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="76">标题</td>
<td width="324" height="20"><input name="title" type="text" id="title"></td>
</tr>
<tr>
<td>处处</td>
<td height="20"><input name="come" type="text" id="come"></td>
</tr>
<tr>
<td>内容</td>
<td><textarea name="cont" rows="10" id="cont"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td height="20"><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit" value="重置"></td>
</tr>
</table>

<input type="hidden" name="MM_insert" value="form1">
</form></td>
</tr>
<tr>
<td height="20">&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<%
news.Close();
%>



yyc2003

职务:普通成员
等级:1
金币:0.0
发贴:5
#32005/2/17 0:09:04
调用数据库的页面 coontest.asp 代码是:
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_coontest_STRING = "driver={Microsoft Access Driver (*.mdb)};dbq=d:\inetpub\wwwroot\mytest\databases\test.mdb"
%>



yyc2003

职务:普通成员
等级:1
金币:0.0
发贴:5
#42005/2/17 0:11:45
第一帖中 第五行出错代码是:
<%@LANGUAGE="javascript" CODEPAGE="936"%>
<!--#include file="Connections/coontest.asp" -->
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");

Recordset1.ActiveConnection = MM_coontest_STRING;
//就是这上面一行 (我觉得会不会是 链接的代码不对呢 ,但是在DW中编辑又能读出数据库的资料。迷茫啊?)
Recordset1.Source = "SELECT * FROM NEWS";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>