473,394 Members | 1,740 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,394 software developers and data experts.

Can you create an updatable query with multible joins

I created 2 tables, each with an autonumber primary key. Fields are:
ID (autonumber Primary key)
Number (single)
Color (Text)
FName (text)in one table and LName (text)in the other

What I'm trying to do is make a select query with not one but two
fields in the join, that will allow me to update the LName field . IE

SELECT FirstName.FName, LastName.LName, FirstName.ID, FirstName.Number,
LastName.ID, LastName.Number
FROM LastName INNER JOIN FirstName ON (LastName.Number =
FirstName.Number) AND (LastName.ID = FirstName.ID);

I've tried:
adding all the joined/keyed/indexed fields
changing the inner joins to left then right joins.
Indexing the number field with no duplicates

Once I add the second join, the query is no longer updatable. Any
comments are welcome.
Thanks in advance,
Adolph

Nov 13 '05 #1
4 6739
You can't _always_ make a multijoin query updateable, but sometimes you can.
Make sure the primary key field of the table(s) you want to update are
contained in the query... without that, you are doomed from the beginning.

Larry Linson
Microsoft Access MVP

"adolph" <ad****@programconsultants.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I created 2 tables, each with an autonumber primary key. Fields are:
ID (autonumber Primary key)
Number (single)
Color (Text)
FName (text)in one table and LName (text)in the other

What I'm trying to do is make a select query with not one but two
fields in the join, that will allow me to update the LName field . IE

SELECT FirstName.FName, LastName.LName, FirstName.ID, FirstName.Number,
LastName.ID, LastName.Number
FROM LastName INNER JOIN FirstName ON (LastName.Number =
FirstName.Number) AND (LastName.ID = FirstName.ID);

I've tried:
adding all the joined/keyed/indexed fields
changing the inner joins to left then right joins.
Indexing the number field with no duplicates

Once I add the second join, the query is no longer updatable. Any
comments are welcome.
Thanks in advance,
Adolph

Nov 13 '05 #2
"Larry Linson" <bo*****@localhost.not> wrote in
news:mRrse.4027$kj5.950@trnddc03:
You can't _always_ make a multijoin query updateable, but
sometimes you can. Make sure the primary key field of the table(s)
you want to update are contained in the query... without that, you
are doomed from the beginning.


Also, the Access-specific DISTINCTROW predicate can often work
wonders, at least for some kinds of queries.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #3
I've My query already has:
1. the keyed field as a join
2. another joined field that is indexed
3. All joined fields (keyed and indexed) from both tables in the
results.

Yet the query is not updatable.
Any ideas? Or can you give a simple example of a multijoined query that
is updatable so I can compare it with mine.
Adolph
*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #4


Adolph Dupre wrote:
I've My query already has:
1. the keyed field as a join
2. another joined field that is indexed
3. All joined fields (keyed and indexed) from both tables in the
results.

Yet the query is not updatable.
Any ideas? Or can you give a simple example of a multijoined query that
is updatable so I can compare it with mine.
Adolph
*** Sent via Developersdex http://www.developersdex.com ***


I've had the exact situation happen to me. Fortunately, when I
replaced a join with the IN (SELECT ... ) syntax the query became
updateable. YMMV.

James A. Fortune

Nov 13 '05 #5

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

Similar topics

13
by: aaron | last post by:
I have a question about (i think) joining. If I have a table in a database that has this info: key - name - favorite 1 - john - 2 2 - judy - 3 3 - joe - 1 the favorite icecream...
0
by: Mario Zoratti | last post by:
Hello, everybody, Please be so kind to explain how it is possible to make a query pass through in Access 97 vs SQL server updatable. The query is "SELECT CDC. * FROM CDC": it is very simple and...
2
by: Johnny M | last post by:
I have been using Access since office 4.3. I have just upgraded to Office 2003 and am having issues with creating updatable queries. If I link one table to a selection query based on the same...
7
by: Martin Lacoste | last post by:
I have a very basic query that Access 2000 will not allow to be updatable. I've gone through all the situations in the help file where data cannot be updated, and I don't see that this query...
14
by: Martin Lacoste | last post by:
Access 2000 Trying even the most basic queries - select queries joining (inner join) two tables - and the results are not updatable, and I can't tell why they aren't. All permissions are on,...
2
by: Enterprise | last post by:
Hi, Here is my code for the Union query "Table union Table union Table ;" The tables are actually queries themselves. I made a form for the query, but when I try to update the...
0
by: CC | last post by:
Dear all, Following Many-to-Many table structure is part of my database ----------------------------------- TbGeneral (dossier information) PK: dsr_id TbDossierSample PK: dsr_sample_id
3
by: sparks | last post by:
I have read in a bunch of files and saved the filename in the table along with the idnumbers and names. Thing is they sent us some files that have to be changed now figures LOL in the...
8
geolemon
by: geolemon | last post by:
I'm trying to perform an update, and I can't avoid this error - I've tried this query what must be 5 different very fundamentally different ways now. Arg. I used to be a DBA in large DB2 and SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.