Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-30-2002, 08:49 PM   PM User | #1
Zvona
Regular Coder

 
Join Date: May 2002
Location: Helsinki, Finland
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Zvona is an unknown quantity at this point
"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
Zvona is offline   Reply With Quote
Old 07-30-2002, 09:34 PM   PM User | #2
Roy Sinclair
Senior Coder

 
Join Date: Jun 2002
Location: Wichita
Posts: 3,880
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Sinclair will become famous soon enough
See http://support.microsoft.com/default...;en-us;Q175168
Roy Sinclair is offline   Reply With Quote
Old 07-30-2002, 11:51 PM   PM User | #3
whammy
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
whammy is an unknown quantity at this point
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. ;)
whammy is offline   Reply With Quote
Old 07-31-2002, 09:10 AM   PM User | #4
Zvona
Regular Coder

 
Join Date: May 2002
Location: Helsinki, Finland
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Zvona is an unknown quantity at this point
Quote:
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
Zvona is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:46 PM.


Advertisement
Log in to turn off these ads.