473,657 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Editing disabled by alternative to INNER JOIN

Hi,

Solved a little mystery yesterday when I built a form that combined 2
tables with a 1:M relationship and relational integrity. All the
correct data was visible on the form but, if I tried to edit any of
the fields, the PC bleeped.

Seems it was due to the query the form was based on. Again, editing
any of the fields of the query caused the PC to bleep.

The problem lay in the SQL behind the query. I'm more comfortable with
SQL than the graphical Design View (in fact I teach classes in SQL).
If you let Access build a query, it will give you:

SELECT * FROM teachers INNER JOIN subjects ON
teachers.name=s ubjects.taught_ by;

but I had typed in the equivalent

SELECT * FROM teachers, subjects WHERE
teachers.name=s ubjects.taught_ by;

The query results are identical, but Access is no longer willing to
write back the edits to the right tables. I guess the INNER JOIN
construction makes possible some safety checking.

I've learned a lesson and perhaps posting this message might help
someone else one day.

Bye for now,

Chris

Aug 3 '07 #1
14 2487
Hi, Chris.
SELECT * FROM teachers INNER JOIN subjects ON
teachers.name=s ubjects.taught_ by;

but I had typed in the equivalent

SELECT * FROM teachers, subjects WHERE
teachers.name=s ubjects.taught_ by;
These two queries are _not_ equivalent in Jet (Access). The second query
uses a Cartesian Join, instead of an ANSI join. A Cartesian Join matches
every row in one table to every row in the other table (even when there is
no logical correlation). A query that uses a Cartesian Join is not
updateable, that's why you hear the beeps. The fact that you placed a WHERE
clause narrowed the results so that the results of the two queries look
identical. However, if you remove the WHERE clause in both queries and then
compare the results, you'll see two very different result sets. Only the
WHERE clause hides the effects of the Cartesian Join (except for the slower
speed when running the query).
I guess the INNER JOIN
construction makes possible some safety checking.
The INNER JOIN allows updateable recordsets, and is much more efficient in
Jet queries. It's easy to run out of resources when using a Cartesian Join
with larger data sets. They take a longer time for Jet to run than when
using an INNER JOIN, too.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
Aug 4 '07 #2
"'69 Camaro" <Fo************ **************@ Spameater.orgZE RO_SPAM>
wrote in news:jFXsi.228$ V53.2@trnddc08:
Hi, Chris.
>SELECT * FROM teachers INNER JOIN subjects ON
teachers.name= subjects.taught _by;

but I had typed in the equivalent

SELECT * FROM teachers, subjects WHERE
teachers.name= subjects.taught _by;

These two queries are _not_ equivalent in Jet (Access). The
second query uses a Cartesian Join, instead of an ANSI join.
You you checked SHOWPLAN on this? I have, and it shows that a JOIN
statement converted to a WHERE clauses is optimized exactly the
same. In this case, the WHERE clause and JOIN is identical, so it
would be treated exactly the same by Jet.
A Cartesian Join matches
every row in one table to every row in the other table (even when
there is no logical correlation).
There will be no Cartesian join in either case, unless there's no
index on the fields in the JOIN/WHERE statement.
A query that uses a Cartesian Join is not
updateable, that's why you hear the beeps. The fact that you
placed a WHERE clause narrowed the results so that the results of
the two queries look identical. However, if you remove the WHERE
clause in both queries and then compare the results, you'll see
two very different result sets. Only the WHERE clause hides the
effects of the Cartesian Join (except for the slower speed when
running the query).
I don't know about editability, but Jet optimizes the two queries
exactly the same way.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 4 '07 #3
On Sat, 04 Aug 2007 09:28:47 GMT, "'69 Camaro"
<Fo************ **************@ Spameater.orgZE RO_SPAMwrote:
>Hi, Chris.
>SELECT * FROM teachers INNER JOIN subjects ON
teachers.name= subjects.taught _by;

but I had typed in the equivalent

SELECT * FROM teachers, subjects WHERE
teachers.name= subjects.taught _by;

These two queries are _not_ equivalent in Jet (Access). The second query
uses a Cartesian Join, instead of an ANSI join. A Cartesian Join matches
every row in one table to every row in the other table (even when there is
no logical correlation). A query that uses a Cartesian Join is not
updateable, that's why you hear the beeps. The fact that you placed a WHERE
clause narrowed the results so that the results of the two queries look
identical. However, if you remove the WHERE clause in both queries and then
compare the results, you'll see two very different result sets. Only the
WHERE clause hides the effects of the Cartesian Join (except for the slower
speed when running the query).
>I guess the INNER JOIN
construction makes possible some safety checking.

The INNER JOIN allows updateable recordsets, and is much more efficient in
Jet queries. It's easy to run out of resources when using a Cartesian Join
with larger data sets. They take a longer time for Jet to run than when
using an INNER JOIN, too.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
I don't believe that this particular example is a "Cartesian Join".
Both forms of the query create a valid ANSI join and are valid ANSI
syntax. The first example uses the newer SQL/92 syntax, the second
uses the older SQL/88 syntax.
Aug 4 '07 #4
Bob Quintal <rq******@sPAmp atico.cawrote in
news:Xn******** **************@ 66.150.105.47:
The where clause approach is still the only one supported by
some major databases, and the Access query builder does not
allow a join on a.field < b.field.
Sure it does. You just have to edit it in SQL view and then not try
to view it with the query designer.

There are also cases in Access where you can't use a join where a
WHERE clause will work. I have to do this frequently with "joins" on
GUID fields in the Jet replication tables. In that case,
updatability is moot, as the tables are not themselves updatable.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 6 '07 #5
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in
news:Xn******** *************** ***********@127 .0.0.1:
Bob Quintal <rq******@sPAmp atico.cawrote in
news:Xn******** **************@ 66.150.105.47:
>The where clause approach is still the only one supported by
some major databases, and the Access query builder does not
allow a join on a.field < b.field.

Sure it does. You just have to edit it in SQL view and then
not try to view it with the query designer.
Try not to view it.... how can one open a query directly to SQL
mode, instead of design view?
>
There are also cases in Access where you can't use a join
where a WHERE clause will work. I have to do this frequently
with "joins" on GUID fields in the Jet replication tables. In
that case, updatability is moot, as the tables are not
themselves updatable.


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 6 '07 #6
On 06 Aug 2007 00:17:30 GMT, Bob Quintal <rq******@sPAmp atico.cawrote:
>Try not to view it.... how can one open a query directly to SQL
mode, instead of design view?
If you save the query while in SQL view the query will open at the SQL view when
design is selected from the database window, not the "standard" design view.
Wayne Gillespie
Gosford NSW Australia
Aug 6 '07 #7
Wayne Gillespie <be*****@NOhotm ailSPAM.com.auw rote in
news:ah******** *************** *********@4ax.c om:
On 06 Aug 2007 00:17:30 GMT, Bob Quintal
<rq******@sPAmp atico.cawrote:
>>Try not to view it.... how can one open a query directly to
SQL mode, instead of design view?

If you save the query while in SQL view the query will open at
the SQL view when design is selected from the database window,
not the "standard" design view.
Wayne Gillespie
Gosford NSW Australia
I wish it would...
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 6 '07 #8

"Bob Quintal" <rq******@sPAmp atico.caschreef in bericht news:Xn******** **************@ 66.150.105.47.. .
Wayne Gillespie <be*****@NOhotm ailSPAM.com.auw rote in
news:ah******** *************** *********@4ax.c om:
>On 06 Aug 2007 00:17:30 GMT, Bob Quintal
<rq******@sPAm patico.cawrote:
>>>Try not to view it.... how can one open a query directly to
SQL mode, instead of design view?

If you save the query while in SQL view the query will open at
the SQL view when design is selected from the database window,
not the "standard" design view.
Wayne Gillespie
Gosford NSW Australia
I wish it would...
It does. I guess you are forgetting to save explicitly

Arno R
Aug 6 '07 #9
Bob Quintal <rq******@sPAmp atico.cawrote in
news:Xn******** **************@ 66.150.105.47:
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in
news:Xn******** *************** ***********@127 .0.0.1:
>Bob Quintal <rq******@sPAmp atico.cawrote in
news:Xn******* *************** @66.150.105.47:
>>The where clause approach is still the only one supported by
some major databases, and the Access query builder does not
allow a join on a.field < b.field.

Sure it does. You just have to edit it in SQL view and then
not try to view it with the query designer.

Try not to view it.... how can one open a query directly to SQL
mode, instead of design view?
The query designer saves the view. If you save it in SQL view, it
will open next in SQL view. In the case of a non-equi-join, the
query designer will never let you switch to design view (just as
with UNION queries).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 6 '07 #10

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

Similar topics

3
3346
by: Ike | last post by:
Oh I have a nasty query which runs incredibly slowly. I am running MySQL 4.0.20-standard. Thus, in trying to expedite the query, I am trying to set indexes in my tables. My query requires four inner joins, as follows : SELECT DISTINCT upcards.id,statuskey.status,upcards.firstname,upcards.lastname,originkey.ori gin,associatekey.username,associatekey2.username,upcards.deleted FROM upcards,status,origins,associates INNER JOIN status...
3
6411
by: Prem | last post by:
Hi, I am having many problems with inner join. my first problem is : 1) I want to know the precedance while evaluating query with multiple joins. eg. select Employees.FirstName, Employees.LastName, TerritoryID, Employees.EmployeeID, RegionID, ProductID from Employees
4
23894
by: Nathan | last post by:
I have an application that uses an Access database to gather information on students' test scores. In the database there are three tables which are joined by one- to-many relationships: Students, Subjects, and Tests. I am trying to create a query that joins these three tables and show all the subjects for only one student, and all the tests taken in each of those subjects. This is the query I have entered in the Query Builder: ...
4
4845
by: Marcos Beccar Varela | GamaCom Argentina | last post by:
Hello Everyone. I need to use a gridview, that when I use the Update command one of the colums, instead of showing a textbox where the user can write, I need a combobox (listobx), where there are 3 options. EG OF GRIDVIEW: USUER AGE carlosg old rominat young gonzalor normal florenciat young
6
9304
by: dmonroe | last post by:
hi group -- Im having a nested inner join problem with an Access SQl statement/Query design. Im running the query from ASP and not usng the access interface at all. Here's the tables: tblEmployees empId -- EmpName -- EmpRole -- EmpManager -------....------------.... ---------....--------------- 1........ dan yella..........1..........2
52
6312
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible variations(combination of fields), - then act on each group in some way ...eg ProcessRs (oRs as RecordSet)... the following query will get me the distinct groups
12
13180
by: Chamnap | last post by:
Hello, everyone I have one question about the standard join and inner join, which one is faster and more reliable? Can you recommend me to use? Please, explain me... Thanks Chamnap
1
4598
by: teneesh | last post by:
Here I have a code for a view that has been created by a developer on my team. I am trying to use the very same code to create a view for a different formid/quesid. But I cannot figure out how this one starts and ends. can someone please help. here's the code from the developer. SELECT a.EvalRecNo, w1.q1, w2.q2, w3.q3, w4.q4, w5.q5, w6.comment FROM (SELECT DISTINCT u.EvalRecNo FROM dbo.UData AS u...
2
4455
by: MATTXtwo | last post by:
I have this store procedure to select data from table with join like this...SELECT tblPeribadi.Personel_No, tblPeribadi.Nama,tblCompany.Keterangan as Company_Code, tblPeribadi.Jawatan, tblPeribadi.Taraf_Jawatan, tblGroup.Keterangan AS Kumpulan,tblPeribadi.Gred,tblBusiness_Area.Keterangan AS Business_Area,tblCost_Center.Keterangan AS Kod_Pusat_Kos, tblPeribadi.IC_Baru, tblPeribadi.IC_Lama, ...
0
8399
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
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
2
1622
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.