När jag ska lägga till en post i en databas får jag detta meddelande:
Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/addst.asp, line 137
Linje 137 är:
'Use the addnew method of the recordset object to add a record
137 -> rs.addnew
'Set the table column = to my input text box from my form
rs("Author") = Request.Form("Author")
.....
'Declare all local variables
dim conn
dim rs
dim strID
dim strconn
'set a local variable to my DSN-less connection String
strconn = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=G:\inetpub\wwwroot\db\quotes.mdb;"
'Create the Connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
'Create the recordset object
set rs = server.createobject("adodb.recordset")
'This statement opens the table so we can add a record notice the addnew
'The 2, 2 is how the table is opened there are many ways it can be opened
rs.open "Quotes", conn, 2, 2
'Use the addnew method of the recordset object to add a record
rs.addnew
'Set the table column = to my input text box from my form
rs("Author") = Request.Form("Author")
rs("Email") = Request.Form("Email")
rs("Category") = Request.Form("Category")
rs("Subcategory") = Request.Form("Subcategory")
rs("Type") = Request.Form("Type")
rs("Quote") = Request.Form("Quote")
rs.update
'Always! Always set your objects to nothing. This clears them out of servers memory
'Your network admins will like this
%>