473,563 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.happ ening = 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.happ ening = 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 1886
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.happ ening = 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.happ ening = 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.happ ening = 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.happ ening = events.event1
set events.event1 = happenings.id
"DuncanIdah o" <Du************ **@googlemail.c omwrote 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.happ ening = 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.happ ening = 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.happ ening = 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
incompehensibl e 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
2406
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 time. However, I have just come across a problem with the new configuration that boggles my mind.... First some configuration data:
12
10000
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 process has been, from the site (in ASP), to: - select the top record from the members table where the assigned flag
22
3022
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 3, NULL, 9, 82, 25
14
3596
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. DELETE FROM TableA FROM TableA x INNER JOIN TableA y ON (x.col_1 = y.col_2) Error msg: The table 'TableA' is ambiguous. Can this be done with SQL...
5
2238
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 DataTable first and I then want to roll through the DataTable while in memory checking for errors and then commit the rows to my database table (btw this...
1
2126
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 stored procedure we believe is at fault, after which no error check was being performed. Under certain conditions, this update is fired against the...
2
1696
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 multiple nodes?" I will use an example to try to explain what I need to do and what I have for data. The example might not be very realistic but it's...
3
4367
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 = db.TableDefs(i) td.Connect = "ODBC;DSN=dsnName;UID=DFS;PWD=DFSpw" td.RefreshLink Next i db.TableDefs.Refresh
3
1780
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 and since a few months it continues in Access2000. My plan is to use Access2000 as it is supposed that mdb-files in Access 2000-format can be...
0
7664
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.