Operation must use an updateable query?

Operation must use an updateable query?

am 22.09.2005 15:29:21 von Spencer Hurst

I keep getting the error: "operation must use an updateable query" when
i try to execute the following code:

<%

p_name = Request("p_name")
p_email = Request("p_email")
p_comment = Request("p_comment")

%>
<% if p_name = "e.g: Spencer Hurst" then

Response.Redirect
"/homepage/guestbook/guestbook_entry.asp?retry=name"

else if p_name = "" then

Response.Redirect
"/homepage/guestbook/guestbook_entry.asp?retry=name"

else if p_email = "" then

Response.Redirect
"/homepage/guestbook/guestbook_entry.asp?retry=email"

else if p_comment = "" then

Response.Redirect
"/homepage/guestbook/guestbook_entry.asp?retry=comment"

else


set datBase = Server.CreateObject ("ADODB.Connection")
Const cDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
datBase.Open cDSN & Server.MapPath (cMDB)
const cMDB = "spencer.mdb"


theSQL = "insert into guestbookentry"
theSQL = theSQL & "(name, email, comment)"
theSQL = theSQL & "values ('"&p_name&"', '"&p_email&"',
'"&p_comment&"')"

datBase.Execute (theSQL)

datBase.Close
set datBase = Nothing

Response.Write "

Guestbook Entry
submitted.

"
Response.Write "

Thank you for your entry, the guestbook has now
been updated. If you wish you may href='/homepage/guestbook/guestbook.asp'>view the guestbook."

end if
end if
end if
end if


%>

the error points to this line: datBase.Execute (theSQL)

Does anybody see a problem that i am missing or know a solution?

Regards

Spencer


*** Sent via Developersdex http://www.developersdex.com ***

Re: Operation must use an updateable query?

am 22.09.2005 16:22:59 von reb01501

Spencer Hurst wrote:
> I keep getting the error: "operation must use an updateable query"
> when i try to execute the following code:
>
http://www.aspfaq.com/show.asp?id=2062

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.