473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Relationships decision to be made...

MLH
I have two tables with a 1 to many relationship between the
parent table and the child table. The parent table is tblOwners
and contains vehicle owner records. The child table is tblVehicleJobs
and contains records of towed vehicles that belong to the owners
in tblOwners.

Trouble is, towing company does not always know the ownership
info when towing a vehicle into the shop. So, its impossible to enter
the owner until after-the-fact when the ownership info is obtained
from the state DMV. I really do wish I could make the settings in
relationships window to enforce referential integrity. Not only is it
good policy, it gives me the advantage of being able to implement
cascading updates/deletes.

Any way to get around this. The vehicle info is ALWAYS known -
make, model, year, etc... But the owner info doesn't come until
later. Hoping someone has worked around this in the past. I'm not
too keen on the 'bogus owner record' deal, as REAL owner info
will eventually be known.
Nov 13 '05 #1
5 1201
Don't know any way around it but creating a dummy "unknown owner"
record in the parent table. Then once you know the real owner, you can
"transfer" ownership to the new record. Since you're just adding a new
owner record and then transferring the vehicle from "unknown" it should
work fine.

Nov 13 '05 #2
MLH wrote:
I have two tables with a 1 to many relationship between the
parent table and the child table. The parent table is tblOwners
and contains vehicle owner records. The child table is tblVehicleJobs
and contains records of towed vehicles that belong to the owners
in tblOwners.

Trouble is, towing company does not always know the ownership
info when towing a vehicle into the shop. So, its impossible to enter
the owner until after-the-fact when the ownership info is obtained
from the state DMV. I really do wish I could make the settings in
relationships window to enforce referential integrity. Not only is it
good policy, it gives me the advantage of being able to implement
cascading updates/deletes.

Any way to get around this. The vehicle info is ALWAYS known -
make, model, year, etc... But the owner info doesn't come until
later. Hoping someone has worked around this in the past. I'm not
too keen on the 'bogus owner record' deal, as REAL owner info
will eventually be known.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Unknown" place holder is the standard method to use when the data is
unknown. Is this Owner identification the Primary Key (PK) and that's
why you don't want to use it - 'cuz of possible duplicates?

What I do in this situation, multiple unknowns, not duplicates, is
create a report that lists all UNKNOWNs that need to be known & run that
in a timely manner. You could also just run the report's query
everytime the application is opened & have a user notification
indication of either the number of Unknown owners or the vehicle IDs
that have missing owner info.

If it comes to many vehicles having the same owner you'll have to have a
"merge" utility that will merge all the unknown owners you created for
the vehicles, into the known owner record. Not that hard just, change
the OwnerID in the vehicles table to the now-known-owner's OwnerID and
delete the old unknown owner records.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQzYmSoechKqOuFEgEQJbnQCffp+EZbm+aUSWGubYiIqfVb TyLjgAoMRx
T6kwSneZ1zDg5DGUYv8knuWp
=dlVO
-----END PGP SIGNATURE-----
Nov 13 '05 #3
This seems to be a little-known feature of referential integrity.
It is perfectly acceptable for the Foreign Key in a child table to contain a
null value.
This indicates that it is not (yet) associated with any record in the master
table.

One way to achieve this is to make sure there is no default value assigned
for that field in its definition in the child table.

Of course, other constraints may keep you from saving this record, but you
can deal with those outside of the question of referential integrity.

HTH
- Turtle

"MLH" <CR**@NorthState.net> wrote in message
news:eo********************************@4ax.com...
I have two tables with a 1 to many relationship between the
parent table and the child table. The parent table is tblOwners
and contains vehicle owner records. The child table is tblVehicleJobs
and contains records of towed vehicles that belong to the owners
in tblOwners.

Trouble is, towing company does not always know the ownership
info when towing a vehicle into the shop. So, its impossible to enter
the owner until after-the-fact when the ownership info is obtained
from the state DMV. I really do wish I could make the settings in
relationships window to enforce referential integrity. Not only is it
good policy, it gives me the advantage of being able to implement
cascading updates/deletes.

Any way to get around this. The vehicle info is ALWAYS known -
make, model, year, etc... But the owner info doesn't come until
later. Hoping someone has worked around this in the past. I'm not
too keen on the 'bogus owner record' deal, as REAL owner info
will eventually be known.

Nov 13 '05 #4
MLH
<censored>
Well, Turtle, you hit it dead on the head. When I created the link
field in the child table, it was set up to automatically set a value
of zero in that field. After changing that, Access allowed records
to be added - no problem. I would like to circumvent Access using
zero as default value for long integer field types added to tables.
Dunno how to do that.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx

This seems to be a little-known feature of referential integrity.
It is perfectly acceptable for the Foreign Key in a child table to contain a
null value.
This indicates that it is not (yet) associated with any record in the master
table.

One way to achieve this is to make sure there is no default value assigned
for that field in its definition in the child table.

Of course, other constraints may keep you from saving this record, but you
can deal with those outside of the question of referential integrity.

HTH
- Turtle

<snip>
Nov 13 '05 #5
I don't know any way to do that automatically, either.
But you only need to set the DefaultValue for each field once, when you
create it.

Just another confirmation of my contention that it's well to allow extra
time at the beginning for table design and implementation. It will pay off
many times over later.

- Turtle
"MLH" <CR**@NorthState.net> wrote in message
news:65********************************@4ax.com...
<censored>
Well, Turtle, you hit it dead on the head. When I created the link
field in the child table, it was set up to automatically set a value
of zero in that field. After changing that, Access allowed records
to be added - no problem. I would like to circumvent Access using
zero as default value for long integer field types added to tables.
Dunno how to do that.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx

This seems to be a little-known feature of referential integrity.
It is perfectly acceptable for the Foreign Key in a child table to contain anull value.
This indicates that it is not (yet) associated with any record in the mastertable.

One way to achieve this is to make sure there is no default value assignedfor that field in its definition in the child table.

Of course, other constraints may keep you from saving this record, but youcan deal with those outside of the question of referential integrity.

HTH
- Turtle

<snip>

Nov 13 '05 #6

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

Similar topics

6
by: Chuck Van Den Corput | last post by:
I have an application with one main table with a jillion attributes. There are numerous other tables, but these are either children of the main table or lookup tables. I am finding that I am...
20
by: Ed | last post by:
I am running Access 2002 and just ran the built in Access wizard for splitting a database into a back end (with tables) and front end (with queries, forms, modules, etc.). After running the...
15
by: James | last post by:
Hello Everyone! I'm trying to design a database for a library that stocks a range of media. (see link) http://homepage.ntlworld.com/james.merrie/private/library.gif Each user can make many...
0
by: Megan | last post by:
Hi Everybody- I know that this is a really, really long post, but I wanted to try to give you as much background as possible. So here's a quick overview of the issues I'm asking for help with:...
5
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a database front-end and noticed that I could not check...
3
by: news.giganews.com | last post by:
Does anyone know if there's an easy way to export or copy the relationship structure from one mdb to a new one? The relationships in the db are time consuming to reproduce. I am trying to make a...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
13
by: ARC | last post by:
Hello all, Prior to going live with my app, I have questions on relationships theory. My prior app was done in Access 97, and I did NOT use relationships at all. I have 65 tables in my...
1
by: ChristianC | last post by:
I'm getting started developing a new database and I've established my tables and I made a few relationships. Now I'm trying to make some changes which involve deleting a few columns in one table that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.