P
pansj1229
Unregistered / Unconfirmed
GUEST, unregistred user!
我在win2000下,向数据库authors(access型)写入数据时发生错误,请问怎么回事
原程序如下
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
<TITLE>Simple ADO Query</TITLE>
</HEAD>
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
<!-- Display Header -->
<font size="4" face="Arial, Helvetica">
<b>Simple ADO Query with ASP</b></font><br>
<hr size="1" color="#000000">
Insert the authors Database:<br><br>
<%
Dim oConn
Dim oRs
Dim filePath
Dim sql
' Map authors database to physical path
filePath = Server.MapPath("authors.mdb")
' Create ADO Connection Component to connect
' with sample database
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
filePath
sql="insert into authors(author,YearBorn)values('peter','1980')"
Set oRs=oConn.execute(sql)
%>
<%
oRs.close
oConn.close
%>
</BODY>
</HTML>
出错信息提示如下
Microsoft JET Database Engine 错误 '80004005'
操作必须使用一个可更新的查询。
/test/insert.asp,行45
原程序如下
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
<TITLE>Simple ADO Query</TITLE>
</HEAD>
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
<!-- Display Header -->
<font size="4" face="Arial, Helvetica">
<b>Simple ADO Query with ASP</b></font><br>
<hr size="1" color="#000000">
Insert the authors Database:<br><br>
<%
Dim oConn
Dim oRs
Dim filePath
Dim sql
' Map authors database to physical path
filePath = Server.MapPath("authors.mdb")
' Create ADO Connection Component to connect
' with sample database
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
filePath
sql="insert into authors(author,YearBorn)values('peter','1980')"
Set oRs=oConn.execute(sql)
%>
<%
oRs.close
oConn.close
%>
</BODY>
</HTML>
出错信息提示如下
Microsoft JET Database Engine 错误 '80004005'
操作必须使用一个可更新的查询。
/test/insert.asp,行45