Hello, Everybody
This is what I get when i am trying to add a new record to a DB:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/Opinion.asp, line 30
This is my code:
<%@ Language=VBScript %>
<%option explicit%>
<html>
<head>
</head>
<body bgcolor="#66ffcc">
<%
dim cnMyConnection
dim strConnectionString
dim rsMyRecordset
set cnMyConnection = Server.CreateObject("ADODB.Connection"
strConnectionString="Driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("YourOpinion.mdb"
set rsMyRecordset = Server.CreateObject("ADODB.Recordset"
cnMyConnection.Open strConnectionString
rsMyRecordset.Open "YourOpinion", cnMyConnection, 1 , 2
rsMyRecordset.AddNew
rsMyRecordset.Fields("Date" = Request.Form("txtDate"
rsMyRecordset.Fields("FirstName" = Request.Form("txtFirst"
rsMyRecordset.Fields("LastName" = Request.Form("txtLast"
rsMyRecordset.Fields("Email" = Request.Form("txtEmail"
rsMyRecordset.Fields("Message" = Request.Form("txtMessage"
rsMyRecordset.Update ' this is line 30 on the page..
set rsMyRecordset = Nothing
rsMyRecordset.Close
set cnMyConnection = Nothing
cnMyConnection.Close
%>
I think I trying everything...
I am running IIS on WIn XP... anybody have a solution!!!
Thanks ahead...
This is what I get when i am trying to add a new record to a DB:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/Opinion.asp, line 30
This is my code:
<%@ Language=VBScript %>
<%option explicit%>
<html>
<head>
</head>
<body bgcolor="#66ffcc">
<%
dim cnMyConnection
dim strConnectionString
dim rsMyRecordset
set cnMyConnection = Server.CreateObject("ADODB.Connection"
strConnectionString="Driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("YourOpinion.mdb"
set rsMyRecordset = Server.CreateObject("ADODB.Recordset"
cnMyConnection.Open strConnectionString
rsMyRecordset.Open "YourOpinion", cnMyConnection, 1 , 2
rsMyRecordset.AddNew
rsMyRecordset.Fields("Date" = Request.Form("txtDate"
rsMyRecordset.Fields("FirstName" = Request.Form("txtFirst"
rsMyRecordset.Fields("LastName" = Request.Form("txtLast"
rsMyRecordset.Fields("Email" = Request.Form("txtEmail"
rsMyRecordset.Fields("Message" = Request.Form("txtMessage"
rsMyRecordset.Update ' this is line 30 on the page..
set rsMyRecordset = Nothing
rsMyRecordset.Close
set cnMyConnection = Nothing
cnMyConnection.Close
%>
I think I trying everything...
I am running IIS on WIn XP... anybody have a solution!!!
Thanks ahead...