|
|
 |
RE: FN-FORUM asp deleting record problem
date posted 27th January 2002 14:25
As would SQL Server if you set up triggers.
You'd only have one foreign key which is the primary key of the master
table (and is needed to delete that record).
So, on the confirmdelete.asp page I'd have the primary key of master as
a form field which is submitted to processconfirmdelete.asp which can
issue the 3 SQL statements listed below.
Rob
-----Original Message-----
From: [EMAIL REMOVED]
[EMAIL REMOVED] On Behalf Of Andy Freeman
Sent: 27 January 2002 12:40
To: [EMAIL REMOVED]
Subject: Re: FN-FORUM asp deleting record problem
Well done for mentioning transactions ...
Of course, if you'd used Oracle instead of ms blah,
you could just set the "Cascade Delete" property of the main table to
true.
And then Oracle would handle all this for you.
:-)
----- Original Message -----
From: Trevor Spink [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Sunday, January 27, 2002 11:49 AM
Subject: RE: FN-FORUM asp deleting record problem
> Nice and neat solution, assumes however that you have available all
the
> foreign keys.
> If you need to run a select to get the FK, things can get a little
more
> ugly. But the use of transactions is essential whether in ASP or
Stored
> Procedure.
>
> -----Original Message-----
> From: [EMAIL REMOVED]
> [EMAIL REMOVED] Behalf Of Robert
Blackmore
> Sent: 27 January 2002 11:15
> To: [EMAIL REMOVED]
> Subject: RE: FN-FORUM asp deleting record problem
>
>
> Hi Ian,
>
> You can use a transaction and execute 3 delete statements from within
> the ASP code.
>
> e.g.
>
> Lcon.BeginTrans
> Lcon.Execute "DELETE * FROM Sub1 WHERE ID = " & LlngID
> Lcon.Execute "DELETE * FROM Sub2 WHERE ID = " & LlngID
> Lcon.Execute "DELETE * FROM Main WHERE ID = " & LlngID
> Lcon.CommitTrans
>
>
> The transaction will ensure that the data is either deleted from all 3
> tables or no tables.
>
> Regards,
>
> Rob
>
> > ----- Original Message -----
> > From: [EMAIL REMOVED]
> > To: "Freelance forum" [EMAIL REMOVED]
> > Sent: Sunday, January 27, 2002 12:53 AM
> > Subject: FN-FORUM asp deleting record problem
> >
> >
> > > I am trying to delete a record from a database table. The record
is
> linked
> > > to via a unique ID to two further tables. (Have been brought in to
> work
> > with
> > > an existing database)
> > >
> > > Is it possible to delete the record from all three tables at the
> same
> > time?
> > > I have found information on the macromedia site about adding to
> multiple
> > > tables from the same page but there seems to be no mention of
> deleting
> > from
> > > more than one table.
> >
> >
> >
> > ===============================================================
> > = SAVE TIME *AND* MAKE MONEY! with Neutralize (**): =
> > = Generate bespoke quotes for Online Marketing Services. =
> > = Resellers info at http://www.neutralize.com & 01209 210 910 =
> > ===============================================================
> >
> > **************************************************************
> > *** Sponsor the forum for as little as £1 at: ***
> > *** ***
> > *** http://www.freelancers.net/cgi/sponsor.cgi?action=show ***
> > **************************************************************
> >
> >
> > Freelancers and Freelance Jobs:
> > http://www.freelancers.net
> >
> > Forum FAQs:
> > http://freelancers.netrickery.com
> >
> > To unsubscribe please email:
> > [EMAIL REMOVED]
> >
> > If you have difficulties unsubscribing please email:
> > [EMAIL REMOVED]
> >
>
>
> ===============================================================
> = SAVE TIME *AND* MAKE MONEY! with Neutralize (**): =
> = Generate bespoke quotes for Online Marketing Services. =
> = Resellers info at http://www.neutralize.com & 01209 210 910 =
> ===============================================================
>
> **************************************************************
> *** Sponsor the forum for as little as £1 at: ***
> *** ***
> *** http://www.freelancers.net/cgi/sponsor.cgi?action=show ***
> **************************************************************
>
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
>
> ===============================================================
> = SAVE TIME *AND* MAKE MONEY! with Neutralize (**): =
> = Generate bespoke quotes for Online Marketing Services. =
> = Resellers info at http://www.neutralize.com & 01209 210 910 =
> ===============================================================
>
> **************************************************************
> *** Sponsor the forum for as little as £1 at: ***
> *** ***
> *** http://www.freelancers.net/cgi/sponsor.cgi?action=show ***
> **************************************************************
>
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
>
> ===============================================================
> = SAVE TIME *AND* MAKE MONEY! with Neutralize (**): =
> = Generate bespoke quotes for Online Marketing Services. =
> = Resellers info at http://www.neutralize.com & 01209 210 910 =
> ===============================================================
>
> **************************************************************
> *** Sponsor the forum for as little as £1 at: ***
> *** ***
> *** http://www.freelancers.net/cgi/sponsor.cgi?action=show ***
> **************************************************************
>
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
===============================================================
= SAVE TIME *AND* MAKE MONEY! with Neutralize (**): =
= Generate bespoke quotes for Online Marketing Services. =
= Resellers info at http://www.neutralize.com & 01209 210 910 =
===============================================================
**************************************************************
*** Sponsor the forum for as little as £1 at: ***
*** ***
*** http://www.freelancers.net/cgi/sponsor.cgi?action=show ***
**************************************************************
Freelancers and Freelance Jobs:
http://www.freelancers.net
Forum FAQs:
http://freelancers.netrickery.com
To unsubscribe please email:
[EMAIL REMOVED]
If you have difficulties unsubscribing please email:
[EMAIL REMOVED]
|
 |
|