Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post

    "Operation must use an updateable query"

    I have an empty head. I can't figure out how I can insert & update data in db :
    Code:
    
    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
    Zvona
    First Aid for
    Web Design

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by Roy Sinclair
    See http://support.microsoft.com/default...;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.
    Zvona
    First Aid for
    Web Design


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •