Read only fejl
Jeg har problemer med en read-only fejl til en Access database, er der nogen, som kan hjælpe mig?Fejlmeldingen er følgende:
Microsoft JET Database Engine error \'80040e09\'
Cannot update. Database or object is read-only.
/diskussion/post.asp, line 29
min post.asp ser ud som følger:
<HTML>
<HEAD>
<TITLE>Discussion Forum : by Claus Ransborg</TITLE>
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">
<LINK REL=\"stylesheet\" HREF=\"forum.css\">
</HEAD>
<BODY BGCOLOR=\"#FFFFFF\" LEFTMARGIN=\"0\" TOPMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">
<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"12\" BGCOLOR=\"#F0F0F0\">
<TR VALIGN=\"TOP\">
<TD ALIGN=\"center\"><H1>Discussion Forums at <%= SiteTitle %></H1></TD>
</TR>
</TABLE>
<BR>
<%
Dim DB, InReplyTo, rsInReplyTo, IsAReply
Set DB = Connect (ForumMDB)
If Request (\"Action\") = \"Send Message\" Then
\' We are into the second step: We should be inserting the records now.
\' Open a Recordset so that we can insert it into the \"Messages\" table.
Dim rsMessage
Set rsMessage = Server.CreateObject (\"ADODB.Recordset\")
rsMessage.Open \"Messages\", DB, adOpenKeyset, adLockPessimistic
\' Create a new, blank record.
rsMessage.AddNew
\' Now set all fields to the values we got from the form.
rsMessage (\"ForumID\") = Request (\"ForumID\")
rsMessage (\"PostedBy\") = Request (\"PostedBy\")
rsMessage (\"Email\") = Request (\"Email\")
rsMessage (\"Subject\") = Request (\"Subject\")
rsMessage (\"Body\") = Request (\"Body\")
rsMessage (\"InReplyTo\") = Request (\"InReplyTo\")
rsMessage (\"Date\") = Now
\' And save them.
rsMessage.Update
\' We also need to update the \"Last Post on\" and \"Total Posts\"
\' for the corresponding forum.
Dim rsForum
Set rsForum = Server.CreateObject (\"ADODB.Recordset\")
rsForum.Open \"SELECT Posts, LastPost FROM Forums WHERE ForumID = \" & Request (\"ForumID\"), DB, adOpenKeyset, adLockPessimistic
\' Update the values with the new values:
\' Increment \"Posts\" & set the time of the last post as Now.
rsForum (\"Posts\") = rsForum (\"Posts\") + 1
rsForum (\"LastPost\") = Now
rsForum.Update
\' Set cookies for the \"From\" and \"Email\" fields,
\' so that the user need not enter them again
\' if he sends another message in the same session.
\' Cookies are saved only for the session, not permanently.
Response.Cookies (SiteTitle)(\"PostedBy\") = Request(\"PostedBy\")
Response.Cookies (SiteTitle)(\"Email\") = Request(\"Email\")
\' Take the user to the Forum page, so he can see the
\' message he just posted.
Response.Redirect \"forum.asp?ForumID=\" & Request (\"ForumID\")
Else
\' Else means, we are still in Step1,
\' and we should display the form.
\' Is this message in reply to some other message,
\' or is it an original message?
InReplyTo = Request (\"InReplyTo\")
\' \"IsAReply\" is a Boolean variable that means the following:
\' True : This is in reply to a message.
\' False : This is an original message.
If InReplyTo <> 0 And InReplyTo <> \"\" Then
IsAReply = True
Set rsInReplyTo = DB.Execute (\"SELECT * FROM Messages WHERE MessageID = \" & InReplyTo)
End If
\' If it\'s not a reply, and the ForumID is not supplied,
\' then something is wrong. Take the user back.
\' Beware, it is NOT an error if this is a reply & the ForumID.
\' If we have the original message, we can determine which Forum this belongs to.
If Not IsAReply And (Request (\"ForumID\") = \"\" Or Request (\"ForumID\") = 0) Then
Response.Redirect \"forum.asp\"
End If
%>
<TABLE WIDTH=\"90%\" BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"8\" ALIGN=\"CENTER\">
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\" BGCOLOR=\"#FFFFFF\">
<TD COLSPAN=\"2\">Post a Message <% If IsAReply Then Response.Write \" in reply to <B>\" & rsInReplyTo(\"Subject\") & \"</B> by <B>\" & rsInReplyTo (\"PostedBy\") & \"</B>\"%></TD>
</TR>
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\" BGCOLOR=\"#FFFFFF\">
<TD COLSPAN=\"2\">
<FORM ACTION=\"<%= Request.ServerVariables (\"PATH_INFO\") %>\">
<INPUT TYPE=\"hidden\" NAME=\"ForumID\" VALUE=\"<% If IsAReply Then Response.Write rsInReplyTo (\"ForumID\") Else Response.Write Request (\"ForumID\") %>\">
<INPUT TYPE=\"hidden\" NAME=\"InReplyTo\" VALUE=\"<% If InReplyTo = \"\" Then Response.Write \"0\" Else Response.Write InReplyTo %>\">
<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"4\" ALIGN=\"CENTER\">
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\">
<TD WIDTH=\"20%\" ALIGN=\"RIGHT\">From:</TD>
<TD WIDTH=\"80%\">
<INPUT TYPE=\"text\" NAME=\"PostedBy\" SIZE=\"60\" MAXLENGTH=\"50\" VALUE=\"<%= Request.Cookies (SiteTitle)(\"PostedBy\") %>\">
</TD>
</TR>
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\">
<TD WIDTH=\"20%\" ALIGN=\"RIGHT\">Email Address:</TD>
<TD WIDTH=\"80%\">
<INPUT TYPE=\"text\" NAME=\"Email\" SIZE=\"60\" MAXLENGTH=\"100\" VALUE=\"<%= Request.Cookies (SiteTitle)(\"Email\") %>\">
</TD>
</TR>
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\">
<TD WIDTH=\"20%\" ALIGN=\"RIGHT\">Subject:</TD>
<TD WIDTH=\"80%\">
<INPUT TYPE=\"text\" NAME=\"Subject\" SIZE=\"60\" MAXLENGTH=\"100\" VALUE=\"<% If IsAReply Then Response.Write \"Re: \" & rsInReplyTo (\"Subject\")%>\">
</TD>
</TR>
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\">
<TD WIDTH=\"20%\" ALIGN=\"RIGHT\">Message:</TD>
<TD WIDTH=\"80%\">
<TEXTAREA NAME=\"Body\" COLS=\"50\" ROWS=\"12\"><% If IsAReply Then Response.Write \"> \" & (Replace (rsInReplyTo(\"Body\"), vbCrLf, vbCrLf + \"> \"))%></TEXTAREA>
</TD>
</TR>
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\">
<TD WIDTH=\"20%\" ALIGN=\"RIGHT\"> </TD>
<TD WIDTH=\"80%\">
<INPUT TYPE=\"submit\" NAME=\"Action\" VALUE=\"Send Message\">
</TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
</TABLE>
<%
End If
%>
<BR>
<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"6\" ALIGN=\"CENTER\">
<TR ALIGN=\"CENTER\" VALIGN=\"TOP\">
<TD COLSPAN=\"2\" ALIGN=\"LEFT\">
<H6>© 2001, Claus Ransborg.</H6>
</TD>
<TD ALIGN=\"RIGHT\" WIDTH=\"20%\">
<DIV ALIGN=\"RIGHT\"><A HREF=\"http://www.sickmann.dk\"><IMG SRC=\"mt45x45.gif\" WIDTH=\"45\" HEIGHT=\"45\" BORDER=\"0\"></A></DIV>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
