连接又出错了,请求帮助.
Microsoft JET Database Engine 错误 '80004005'
'E:\home\LocalUser\516333\data\data.mdb'不是一个有效的路径。 确定路径名称拼写是否正确,以及是否连接到文件存放的服务器。
/shouye.asp,行 8
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_conn_STRING
MM_conn_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("../")& "\data\data.mdb"
%>
------解决方案--------------------try:
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../data/date.mdb")
------解决方案--------------------server.MapPath("data/date.mdb")
date.mdb?
是不是data.mdb啊
数据库文件名没搞错啵?
------解决方案--------------------ASP连接access数据库例程
<%
Dim mode
mode=request.form("text4")
if mode=1 then
name=request.form("text1")
age=request.form("text2")
addr=request.form("text3")
if not isnumeric(age) then response.write "age must be number!<a href=javascript:history.go(-1)>try again</a>":response.end
age=clng(age)
end if '********************************************************************
' 与AccessDB相关的连接信息
' 可以参照它建立您的数据库连接
'********************************************************************
Dim conn,rs,dbpath
Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.RecordSet")
dbpath=Server.MapPath("rwdata/db_test_com.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ="&dbpath
'********************************************************************
'********************************************************************
dim strsql
'********************************************************************
' 读数据库相关操作
sub readdb()
strsql="select * from test"
rs.open strsql,conn,1,1
if rs.EOF then response.write "no record at all":exit sub
response.write "<table border=1>"
response.write "<tr>"
for i=0 to rs.Fields.Count-1
response.write "<td><font color=blue>"&rs.Fields(i).Name&"</font></td>"
next
response.write "</tr>"
while not rs.EOF
response.write "<tr>"
for i=0 to rs.Fields.Count-1
response.write "<td>"&rs.Fields(i).value&"</td>"
next
response.write "</tr>"
rs.MoveNext
wend
response.write "</table>"
rs.Close
end sub
'********************************************************************
'********************************************************************
' 写数据库相关
sub insertdata()
strsql="INSERT INTO test(name,age,addr) valueS('"&name&"',"&age&",'"&addr&"')"
rs.Open strsql,conn,1,3
end sub
'********************************************************************
if mode=1 then
call insertdata()
response.write "insert ok!"
elseif mode=2 then
call readdb()
end if
'********************************************************************
' 释放数据库连接对象
set rs=nothing
set conn=nothing
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<script language=javascript>
function clickit(flag){