?
Solved

"Operation must be an updateable query" error

Posted on 2005-03-18
1
Medium Priority
?
488 Views
Last Modified: 2011-09-20
folks,

i am getting the error:

 "Operation must be an updateable query"

when i try to run the following quey from within MS Access 2003.

UPDATE STUDENTS SET SSN = (SELECT SOONER_ID.Sooner_ID  FROM SOONER_ID  WHERE SOONER_ID.SSN = STUDENTS.Student_ID)
WHERE Exists (SELECT SOONER_ID.Sooner_ID  FROM SOONER_ID  WHERE SOONER_ID.SSN = STUDENTS.Student_ID);

here is the table structure

STUDENTS
------------
SSN
Student_ID

SOONER_ID
-------------
SSN
Sooner_ID


If i modify the query like so:

 UPDATE STUDENTS SET SSN = '01234567891'
WHERE Exists (SELECT SOONER_ID.Sooner_ID  FROM SOONER_ID  WHERE SOONER_ID.SSN = STUDENTS.Student_ID);

it works fine. i've checked and i do have read/write access to the .mdb file in question.

what is the problem here?

Thanks.
0
Comment
Question by:Lou1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 2000 total points
ID: 13578818
The subselect is causing your query to be non-updatable - you'll need to remove this part. If your subselect can possibly return more than one record, this will definitely be the case. Try this:

UPDATE STUDENTS SET SSN=DLookUp("[Sooner_ID]","SOONER_ID","[SSN]=" & STUDENTS.Student_ID) WHERE Exists (SELECT SOONER_ID.Sooner_ID  FROM SOONER_ID  WHERE SOONER_ID.SSN = STUDENTS.Student_ID)

This will update SSN with the first located record in SOONER_ID - if there are multiple different values for the same Student_ID, it will not be predictable which one is used.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question