Operation must use an updateable query

V

Viswanathan S

Hi All,

I am using OLE DB connection from VB.NET. I uses update statement having
subquery, it gives error message as "Operation must use an updateable
query".

The query i used is

UPDATE oecd2 SET oecd2.C_Commodity = (select MANT_COMCODEMATCH.C_Commodity
from MANT_COMCODEMATCH where oecd2.C_Commodity = C_OECDLCommodity )

If i use the select statement it is execued and update statement alone also
executed in Access. But when i use this subquery, it gives the above error.

How can i solve it?
 
D

Dave Monks

I assume you are using an OLE DB for Jet connection for the query that you
are trying to run.
The Jet DB engine treats any query with a subquery as non-updateable.
You will need to re-write your query to not use a subquery, try using an
inner join instead of the subquery.
The easiest way to get something that works would be to write the query in
Access first, then just copy the sql to your .net app.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top