S
salmonella
I have a REAL problem. I am writing a Db that will track bacteria, diagnostic
tests, etc. in my laboratory. At present it has 37 tables and growing. The
root of the problem is that in many cases I need to collect the same data in
relation to several other types of data. For example, I need to store
(storage table) things from: samples (sample table), DNA preparations (dna
tests table), bacteria (isolate table), etc. What I did was, instead of
creating separate (but identical) storage tables to join to tables sample,
bacteria, etc. I used just one tbl called storage to join to each of these
other tables. The problem is that because I am joining storage to multiple
tables, I cannot use referential integrity and Cascading Delete to delete it.
So, now I have a database that will just love to collect orphan records.
Because not all records are redundant what I actually have is referential
integrity and cascading delete set on a chain of tables then a “fire breakâ€
then cascading delete again. For example, tbls A-B-C-____D-E-F where there is
cascading delete in the join between all the tables except C and D (storage).
Anyways, I guess that my question is, is there a straightforward way to
deal with this situation (e.g. cascading delete through code or a utility sub
that will remove orphan records), or should I just create separate (but
identical) “storage†tables so that I can use the cascading delete in the
join? Bear in mind that separate tables will balloon the Db GREATLY and
increase the total number of tables by 3 to 4 times (~60-90 tables) and the
Mb size will double or triple- (I possibly can use just one form by just
changing the record source with code as needed).
Being new to all this I am hoping real hard that I am missing something
simple, however if not, does anyone know how to deal with this problem?????
For example, if there was a delete event for table records like there is for
forms, then I could use code to jump the fire break each time a record was
deleted in C above to delete related records in D which, when deleted, would
invoke cascading delete in E, F etc.
ANY ideas on this would be appreciated.
Thanks!!
tests, etc. in my laboratory. At present it has 37 tables and growing. The
root of the problem is that in many cases I need to collect the same data in
relation to several other types of data. For example, I need to store
(storage table) things from: samples (sample table), DNA preparations (dna
tests table), bacteria (isolate table), etc. What I did was, instead of
creating separate (but identical) storage tables to join to tables sample,
bacteria, etc. I used just one tbl called storage to join to each of these
other tables. The problem is that because I am joining storage to multiple
tables, I cannot use referential integrity and Cascading Delete to delete it.
So, now I have a database that will just love to collect orphan records.
Because not all records are redundant what I actually have is referential
integrity and cascading delete set on a chain of tables then a “fire breakâ€
then cascading delete again. For example, tbls A-B-C-____D-E-F where there is
cascading delete in the join between all the tables except C and D (storage).
Anyways, I guess that my question is, is there a straightforward way to
deal with this situation (e.g. cascading delete through code or a utility sub
that will remove orphan records), or should I just create separate (but
identical) “storage†tables so that I can use the cascading delete in the
join? Bear in mind that separate tables will balloon the Db GREATLY and
increase the total number of tables by 3 to 4 times (~60-90 tables) and the
Mb size will double or triple- (I possibly can use just one form by just
changing the record source with code as needed).
Being new to all this I am hoping real hard that I am missing something
simple, however if not, does anyone know how to deal with this problem?????
For example, if there was a delete event for table records like there is for
forms, then I could use code to jump the fire break each time a record was
deleted in C above to delete related records in D which, when deleted, would
invoke cascading delete in E, F etc.
ANY ideas on this would be appreciated.
Thanks!!