...

View Full Version : "Operation must use an updateable query"



Zvona
07-30-2002, 08:49 PM
I have an empty head. I can't figure out how I can insert & update data in db :


1 : <%
2 : Option explicit
3 : Dim aUrl, sUrl, iCount,x
4 :
5 : aUrl = split(Request.ServerVariables("URL"),"/")
6 : sUrl = aUrl(ubound(aUrl))
7 : Session.Contents(sUrl) = false
8 : If NOT Session.Contents(sUrl) Then
9 : Dim dbConn, rsSet
10: Set dbConn = Server.Createobject("ADODB.Connection")
11: Set rsSet = Server.Createobject("ADODB.Recordset")
12:
13: dbConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db\tilastot.mdb")
14:
15: set rsSet = dbConn.execute("SELECT * FROM tilastot WHERE sUrl ='"& sUrl &"'")
16:
17: If rsSet.EOF Then
18: iCount = 1
19: dbConn.execute("INSERT INTO tilastot (sUrl, ICount) VALUES ('testi"& sURL &"',"& iCount&");")
20: Else
21: iCount = cInt(rsSet("iCount")) +1
22: dbConn.execute("UPDATE tilastot SET tilastot.iCount = "& iCount &" WHERE tilastot.sUrl ='"& sUrl &"'")
23: End If
24:
25: Session.Contents(sUrl) = true
26: End If
27:%>

This returns :
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/eternity/tral/monitorExample1.asp, line 22

What should I change, because I'm losing my nerves soon :(

Roy Sinclair
07-30-2002, 09:34 PM
See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q175168

whammy
07-30-2002, 11:51 PM
I have received that same error when my computer (or the computer that the script resides on) did not have permissions to access the server, if I remember correctly. Hope that helps!

Zvona
07-31-2002, 09:10 AM
Originally posted by Roy Sinclair
See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q175168

Yup. That was the reason, I remember fighting with this earlier at work. I was too tired and frustrated yesterday to search through Microsoft's site (sorry), though that had brought a faster solution.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum