If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Wrong message with cascading deletes
A2003: Table Person linked 1 X M to table Activity. The relationship has its
Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#2
|
|||
|
|||
Wrong message with cascading deletes
Are you certain your relationships are set up properly?
Is there a 1 at the Person end of the relationship and an infinity sign at the Activity end in the Relationships diagram? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Lars Brownies" wrote in message ... A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#3
|
|||
|
|||
Wrong message with cascading deletes
Yes, it's set up like that.
Lars "Douglas J. Steele" schreef in bericht ... Are you certain your relationships are set up properly? Is there a 1 at the Person end of the relationship and an infinity sign at the Activity end in the Relationships diagram? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Lars Brownies" wrote in message ... A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#4
|
|||
|
|||
Wrong message with cascading deletes
I imported only the respective tables into a new db, made the exact same
link, and that works fine. The Person table is linked to about 15 other tables, so I'm thinking it has something to with them and their relationships(?) Lars "Lars Brownies" schreef in bericht ... Yes, it's set up like that. Lars "Douglas J. Steele" schreef in bericht ... Are you certain your relationships are set up properly? Is there a 1 at the Person end of the relationship and an infinity sign at the Activity end in the Relationships diagram? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Lars Brownies" wrote in message ... A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#5
|
|||
|
|||
Wrong message with cascading deletes (bug?)
I did some further testing and this seems like a bug. In a new mdb I created
the following tables: 1. tblPerson: PersonID* LastName 2. tblPersonActivity: PersonID* ActivityID* 3. tblPersonAdress: PersonID* AddressID* I linked 1 to 2 (1xM) and 1 to 3 (1xM), both with RI and cascading deletes checked. Table 1 has one record and there's one related record in table 2. Mind you: Table 3 is empty. If I delete the tblPerson's record I don't get the cascading deletes message. If I remove the link from table 1 to 3 and try again, then I do get the cascading deletes message. Now if I repeat the above and first adding a record to table 3, I do get the right message. So if one of the relation tables is empty, you don't get the right message. This doesn't seem like WAD. Lars PS: I skipped the Activity and Address tables and they don't make any difference to the above. "Douglas J. Steele" schreef in bericht ... Are you certain your relationships are set up properly? Is there a 1 at the Person end of the relationship and an infinity sign at the Activity end in the Relationships diagram? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Lars Brownies" wrote in message ... A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#6
|
|||
|
|||
Wrong message with cascading deletes (bug?)
On Sun, 23 May 2010 20:14:18 +0200, "Lars Brownies"
wrote: I am able to confirm this behavior with A2010 accdb. This is indeed at least weird and possibly a bug. Report it. -Tom. Microsoft Access MVP I did some further testing and this seems like a bug. In a new mdb I created the following tables: 1. tblPerson: PersonID* LastName 2. tblPersonActivity: PersonID* ActivityID* 3. tblPersonAdress: PersonID* AddressID* I linked 1 to 2 (1xM) and 1 to 3 (1xM), both with RI and cascading deletes checked. Table 1 has one record and there's one related record in table 2. Mind you: Table 3 is empty. If I delete the tblPerson's record I don't get the cascading deletes message. If I remove the link from table 1 to 3 and try again, then I do get the cascading deletes message. Now if I repeat the above and first adding a record to table 3, I do get the right message. So if one of the relation tables is empty, you don't get the right message. This doesn't seem like WAD. Lars PS: I skipped the Activity and Address tables and they don't make any difference to the above. "Douglas J. Steele" schreef in bericht ... Are you certain your relationships are set up properly? Is there a 1 at the Person end of the relationship and an infinity sign at the Activity end in the Relationships diagram? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Lars Brownies" wrote in message ... A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#7
|
|||
|
|||
Wrong message with cascading deletes
"Lars Brownies" wrote:
A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. I have an intense dislike for cascade deletes in Microsoft Access. And I don't like cascade updates. http://www.granite.ab.ca/access/cascadeupdatedelete.htm Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/ |
#8
|
|||
|
|||
Wrong message with cascading deletes (bug?)
Thanks. I've googled but I am not sure where to report it.
Lars "Tom van Stiphout" schreef in bericht ... On Sun, 23 May 2010 20:14:18 +0200, "Lars Brownies" wrote: I am able to confirm this behavior with A2010 accdb. This is indeed at least weird and possibly a bug. Report it. -Tom. Microsoft Access MVP I did some further testing and this seems like a bug. In a new mdb I created the following tables: 1. tblPerson: PersonID* LastName 2. tblPersonActivity: PersonID* ActivityID* 3. tblPersonAdress: PersonID* AddressID* I linked 1 to 2 (1xM) and 1 to 3 (1xM), both with RI and cascading deletes checked. Table 1 has one record and there's one related record in table 2. Mind you: Table 3 is empty. If I delete the tblPerson's record I don't get the cascading deletes message. If I remove the link from table 1 to 3 and try again, then I do get the cascading deletes message. Now if I repeat the above and first adding a record to table 3, I do get the right message. So if one of the relation tables is empty, you don't get the right message. This doesn't seem like WAD. Lars PS: I skipped the Activity and Address tables and they don't make any difference to the above. "Douglas J. Steele" schreef in bericht ... Are you certain your relationships are set up properly? Is there a 1 at the Person end of the relationship and an infinity sign at the Activity end in the Relationships diagram? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Lars Brownies" wrote in message ... A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/art...26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: "You are about to delete 1 record(s). If you click Yes. you won't be able to Undo this Delete operation. Are you sure you want to delete this records?" Can someone explain what's going on? Thanks, Lars |
#9
|
|||
|
|||
Wrong message with cascading deletes
It seems like your main concern is the lousy message you get when you're
cascadingly deleting. I agree. For some relationships I wouldn't want cascading deletes because it's too risky, but for other relationships I think the built in cascading deletion can come in handy. I'm thinking of replacing the default message by something like: Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer) Response = acDataErrContinue If MsgBox("Warning!" & vbCrLf & vbCrLf & _ "Deleting this record will also delete " & _ "the related records in the Activity table." & vbCrLf & vbCrLf & _ "Are you sure you want to continue?", _ vbOKCancel + vbExclamation + vbDefaultButton2) = vbCancel Then Cancel = True End If End Sub Lars "Tony Toews [MVP]" schreef in bericht ... "Lars Brownies" wrote: A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. I have an intense dislike for cascade deletes in Microsoft Access. And I don't like cascade updates. http://www.granite.ab.ca/access/cascadeupdatedelete.htm Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/ |
#10
|
|||
|
|||
Wrong message with cascading deletes
FWIW, I usually go one step further, Lars, and calculate the number of
records that will be deleted (using DCount). -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/djsteele Co-author: Access 2010 Solutions, published by Wiley (no e-mails, please!) "Lars Brownies" wrote in message ... It seems like your main concern is the lousy message you get when you're cascadingly deleting. I agree. For some relationships I wouldn't want cascading deletes because it's too risky, but for other relationships I think the built in cascading deletion can come in handy. I'm thinking of replacing the default message by something like: Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer) Response = acDataErrContinue If MsgBox("Warning!" & vbCrLf & vbCrLf & _ "Deleting this record will also delete " & _ "the related records in the Activity table." & vbCrLf & vbCrLf & _ "Are you sure you want to continue?", _ vbOKCancel + vbExclamation + vbDefaultButton2) = vbCancel Then Cancel = True End If End Sub Lars "Tony Toews [MVP]" schreef in bericht ... "Lars Brownies" wrote: A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. I have an intense dislike for cascade deletes in Microsoft Access. And I don't like cascade updates. http://www.granite.ab.ca/access/cascadeupdatedelete.htm Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/ |
|
Thread Tools | |
Display Modes | |
|
|