Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 errror: Operation must use an updateable query

Author  Topic 

domagoj
Starting Member

5 Posts

Posted - 2003-03-23 : 19:19:59
Error message:
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.

Happens since server admin worked on his server

Tried to execute SQL string from ASP - error
Tried to execute stored query from ASP ("Exec myquery") - error
The same query works fine inside MSAccess

stored query (myquery):
UPDATE ad SET brojac = brojac-1
WHERE id=1;

Anybody knows what's goin' on?

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-03-24 : 02:50:17
Is your ADO connection read-only? It seems that sometimes Access connections from ASP are opened in read-only mode. Try adding the Mode parameter to the connection string:
Mode=3 --adModeReadWrite
or Mode=12 --adModeShareExclusive


OS

Go to Top of Page

domagoj
Starting Member

5 Posts

Posted - 2003-03-24 : 05:48:59
This is connection I used

Set Con = Server. CreateObject ("ADODB.Connection")
Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & application("PathToDatabase") & ";"
Set RS = con.execute ("Exec MyQuery")

Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-03-24 : 07:42:21
Many queries are NOT updatable -- what is the query you are trying to update?

If the query includes group by's, unions, or joins that are not specifically indicated in the relationships screen, those are ususally common cases.

- Jeff
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-03-24 : 08:30:07
This query will not return a recordset, so the syntax
Set rs = conn.Execute ("Exec MyQuery")
does not make sense. Try using a ADO Command Object instead, set the Command Type to adCmdStoredProc, set the CommandText to the name of the query, and execute!

Update Queries in Access are analogous to SQL Stored Procedures in ADO. Hence you must use Command Objects to run Update, Delete, etc. queries.

OS

Go to Top of Page

Doug G
Constraint Violating Yak Guru

331 Posts

Posted - 2003-03-26 : 12:25:18
Maybe something here will help.

http://www.dougscode.com/forum4/topic.asp?TOPIC_ID=5


======
Doug G
======
Go to Top of Page
   

- Advertisement -