473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is it possible to do a select withing update in Access2000

Hi

Apologies if this is similar to a (very) recent post.

I was wondering if it is possible to execute an update query that
contains a select statement on an MS access 2000 database.
I have included a detaled example at the bottom of this post

I have the following update query that works as I expect it to on a
MySQL database

update events set events.event1 = (select happenings.id from happenings
where happenings.happening = events.event1);

If I try to run this query on an access database with exactly the same
tables I get the following message

"Operation must use an updateable query"

Now I have had a look around and others who have been experiencing this
seem to be having permissions problems, however if I change the query as
follows update events set events.event1 = (1); it works fine although
obviously this is not what I need.

Is it possible to execute an update query that contains a select
statement on an MS access 2000 database ?

Thanks in advance

Idaho

========= Detailed example follows ==========

Say we have the tables events and happenings

//events
+----+-----------+------------+------------+------------+------------
| id | somefield | event1 | event2 | event3 | event4
+----+-----------+------------+------------+------------+------------
| 1 | whatever | happening1 | happening2 | happening5 | happening3
| 2 | another | happening5 | happening3 | happening4 | happening1
+----+-----------+------------+------------+------------+------------

//happenings
+----+------------+
| id | happening |
+----+------------+
| 1 | happening1 |
| 2 | happening2 |
| 3 | happening3 |
| 4 | happening4 |
| 5 | happening5 |
+----+------------+

to update the event1 field in the events table with the key for
happening1 I simply run this query

update events set events.event1 = (select happenings.id from happenings
where happenings.happening = events.event1);

This gives the following result

+----+-----------+--------+------------+------------+------------
| id | somefield | event1 | event2 | event3 | event4
+----+-----------+--------+------------+------------+------------
| 1 | whatever | 1 | happening2 | happening5 | happening3
| 2 | another | 5 | happening3 | happening4 | happening1
+----+-----------+--------+------------+------------+------------

Which is what I want, but Access 2000 barfs with the almost
incompehensible message
"Operation must use an updateable query"
Aug 7 '08 #1
2 1873
DuncanIdaho wrote:
Hi

Apologies if this is similar to a (very) recent post.

Hmm, this seems to work
update events happenings set events.event1 = happenings.id where
happenings.happening = events.event1
er ... well anyway, it works,

Thanks anyway

Idaho
>
I was wondering if it is possible to execute an update query that
contains a select statement on an MS access 2000 database.
I have included a detaled example at the bottom of this post

I have the following update query that works as I expect it to on a
MySQL database

update events set events.event1 = (select happenings.id from happenings
where happenings.happening = events.event1);

If I try to run this query on an access database with exactly the same
tables I get the following message

"Operation must use an updateable query"

Now I have had a look around and others who have been experiencing this
seem to be having permissions problems, however if I change the query as
follows update events set events.event1 = (1); it works fine although
obviously this is not what I need.

Is it possible to execute an update query that contains a select
statement on an MS access 2000 database ?

Thanks in advance

Idaho

========= Detailed example follows ==========

Say we have the tables events and happenings

//events
+----+-----------+------------+------------+------------+------------
| id | somefield | event1 | event2 | event3 | event4
+----+-----------+------------+------------+------------+------------
| 1 | whatever | happening1 | happening2 | happening5 | happening3
| 2 | another | happening5 | happening3 | happening4 | happening1
+----+-----------+------------+------------+------------+------------

//happenings
+----+------------+
| id | happening |
+----+------------+
| 1 | happening1 |
| 2 | happening2 |
| 3 | happening3 |
| 4 | happening4 |
| 5 | happening5 |
+----+------------+

to update the event1 field in the events table with the key for
happening1 I simply run this query

update events set events.event1 = (select happenings.id from happenings
where happenings.happening = events.event1);

This gives the following result

+----+-----------+--------+------------+------------+------------
| id | somefield | event1 | event2 | event3 | event4
+----+-----------+--------+------------+------------+------------
| 1 | whatever | 1 | happening2 | happening5 | happening3
| 2 | another | 5 | happening3 | happening4 | happening1
+----+-----------+--------+------------+------------+------------

Which is what I want, but Access 2000 barfs with the almost
incompehensible message
"Operation must use an updateable query"
Aug 7 '08 #2
Or, perhaps:

update events INNER JOIN happenings ON happenings.happening = events.event1
set events.event1 = happenings.id
"DuncanIdaho" <Du**************@googlemail.comwrote in message
news:kJ******************************@bt.com...
DuncanIdaho wrote:
>Hi

Apologies if this is similar to a (very) recent post.


Hmm, this seems to work
update events happenings set events.event1 = happenings.id where
happenings.happening = events.event1
er ... well anyway, it works,

Thanks anyway

Idaho
>>
I was wondering if it is possible to execute an update query that
contains a select statement on an MS access 2000 database.
I have included a detaled example at the bottom of this post

I have the following update query that works as I expect it to on a MySQL
database

update events set events.event1 = (select happenings.id from happenings
where happenings.happening = events.event1);

If I try to run this query on an access database with exactly the same
tables I get the following message

"Operation must use an updateable query"

Now I have had a look around and others who have been experiencing this
seem to be having permissions problems, however if I change the query as
follows update events set events.event1 = (1); it works fine although
obviously this is not what I need.

Is it possible to execute an update query that contains a select
statement on an MS access 2000 database ?

Thanks in advance

Idaho

========= Detailed example follows ==========

Say we have the tables events and happenings

//events
+----+-----------+------------+------------+------------+------------
| id | somefield | event1 | event2 | event3 | event4
+----+-----------+------------+------------+------------+------------
| 1 | whatever | happening1 | happening2 | happening5 | happening3
| 2 | another | happening5 | happening3 | happening4 | happening1
+----+-----------+------------+------------+------------+------------

//happenings
+----+------------+
| id | happening |
+----+------------+
| 1 | happening1 |
| 2 | happening2 |
| 3 | happening3 |
| 4 | happening4 |
| 5 | happening5 |
+----+------------+

to update the event1 field in the events table with the key for
happening1 I simply run this query

update events set events.event1 = (select happenings.id from happenings
where happenings.happening = events.event1);

This gives the following result

+----+-----------+--------+------------+------------+------------
| id | somefield | event1 | event2 | event3 | event4
+----+-----------+--------+------------+------------+------------
| 1 | whatever | 1 | happening2 | happening5 | happening3
| 2 | another | 5 | happening3 | happening4 | happening1
+----+-----------+--------+------------+------------+------------

Which is what I want, but Access 2000 barfs with the almost
incompehensible message
"Operation must use an updateable query"

Aug 7 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: skidvd | last post by:
Hello: I have just recently converted to using the InnoDB table type so that I can enforce FOREIGN key constraints. I have been using MyISAM tables (accessed via JDBC) successfully for some...
12
by: M Wells | last post by:
Hi All, I have a table that holds pregenerated member IDs. This table is used to assign an available member id to web site visitors who choose to register with the site So, conceptually the...
22
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20...
14
by: php newbie | last post by:
I am getting error messages when I try to delete from a table using the values in the table itself. The intent is to delete all rows from TableA where col_2 matches any of the col_1 values. ...
5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
1
by: M Wells | last post by:
Hi All, Further to my previous long-winded question about a situation in which we appear to be mysteriously losing data from our mssql2k server. We discovered an update statement, in the...
2
by: Andreas Håkansson | last post by:
Seeing how my previous post seem to have fallen between the cracks, I thought I would have a second, more direct, go at it. So my question is "Is it possible to group (Muenchian method) over...
3
by: DFS | last post by:
This code fails to update the connection strings (Access97 - SQL Server 2000 table links). It works in Access2000. Public Sub updateConnStrings() For i = 0 To db.TableDefs.Count - 1 Set td =...
3
by: olle | last post by:
How to deal with a VBA-project that is damaged? Hi everyone. I am BigOlle from sweden and I have been working with Accees for ten years I am now working on a project that started in Access97...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.