🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1948

Re: Deleting Records in a Query Result Table

#1948
From: Robert Emmons
Date: Mon, 29 Dec 2003 14:48
35 lines
2789 bytes
On Mon, 29 Dec 2003 07:29:50 +1000, "Daryl" <stockd@tpg.com.au> wrote:

>The other problem is that with ADO you will need to identify the unique
>table if you only want to delete a record from the CustOrders table.  Unique
>table is a property of the recordset.

The Unique table is exactly what I am looking for, but I do not see it
listed as a property in TADOQuery.  Am I missing it?


>You are probably aware of this but it is best to say it.
>In a 'One to Many' relationship, in your case I guess the one side is the
>table CustList and the many side is the table CustOrders.  If you wish to
>delete a record in table CustList and it has related CustOrders then these
>records must be deleted or else they would become orphans - this is not
>possible.  So the relationship between CustList and CustOrders must have
>CascadeDeletes active.  You can see this by checking the properties of this
>relationship in MS Access.

Thanks for the info, but the last thing I want is cascading deletes.
I want to avoid deleting records in the parent CustList table.
Cascading deletes would cause a catastrophy in this case.  It would
better be described as whipsawing cascading deletes.  An attempt to
delete a single CustOrders record would delete the corresponding
CustList record, and cascading deletes would then delete all the
CustOrders records related to that CustList record.

>Now by doing an INNER join between the two tables then you will only get the
>records in thew CustList table that have one or more records in the table
>CustOrders.  DISTINCTROW is an MS Access extension keyword that allows the
>recordset to able to be edited where it may normally not, don't think you
>need it here.

In MSAccess, I was only able to delete the CustOrders record by using
DISTINCTROW.  Perhaps, I should try it with DISTINCT in ADO.
Technical Details
Message-ID: <hjf0vvk67flg6aegiun04m24s0n0fqvp8o@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <am4suvgp2h473hlagl3ur1jimaamfdi7u5@4ax.com> <3fef4c08@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,2bc0d782656ee7e1
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-12-29 07:09:55 PST
From: Robert Emmons <remmons@aurigen.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Deleting Records in a Query Result Table
Date: Mon, 29 Dec 2003 09:48:29 -0500
Message-ID: <hjf0vvk67flg6aegiun04m24s0n0fqvp8o@4ax.com>
References: <am4suvgp2h473hlagl3ur1jimaamfdi7u5@4ax.com> <3fef4c08@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 68.193.14.50
X-Trace: newsgroups.borland.com 1072709221 68.193.14.50 (29 Dec 2003 06:47:01 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail