473,786 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1220
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:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQzYmSoechKq OuFEgEQJbnQCffp +EZbm+aUSWGubYi IqfVbTyLjgAoMRx
T6kwSneZ1zDg5DG UYv8knuWp
=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**@NorthStat e.net> wrote in message
news:eo******** *************** *********@4ax.c om...
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.

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxx

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**@NorthStat e.net> wrote in message
news:65******** *************** *********@4ax.c om...
<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.

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxx

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
1957
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 using up all my indices on the main table to support the relationships with all the child and lookup tables. My question is this: would anyone suggest or caution against the use of tables that are related to the main table in a 1:1 relationship?
20
3027
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 wizard, I opened the table relationship view and noticed that all the relationships are missing. Is this supposed to happen? If so, why? I've noticed that queries are behaving strangely now, seemingly because the relationships are not established....
15
1869
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 enquiries / reservations / loans (if I can get enquiries right, I can do the rest). Every Enquiry can be made on each item of stock, every item of stock is
0
1481
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: 1.) I'm trying to create a many to many relationship, and I get the following Error when I try to enforce referential integrity.
5
4704
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 the referential integrity box. What gives? Continuing on with that line of thinking, I understand what do the relationships do for you in a database, but what do they do physically to the tables? Thanks,
3
7461
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 copy of a database including all the relationships, forms, queries and modules while still within the original database. This has to be a relatively automated process (button click). Any suggestions?
45
3425
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 relationship spaghetti....tables/queries all overthe place with lots of relationship lines between here and there. After that first app I didn't do relationships. If I had a query, I defined the relationship. Many of the times when I create a...
13
2078
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 back-end database, and with Access 97, if you added relationships, it would add multiple copies of the same relationships over and over, so I decided not to use any relationships at all. Additionally, when I needed to add or remove fields via code, it...
1
1596
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 happen to be tied to another table. For some reason when I go to the relationships window it displays the two tables I haved tied, but does not show the relationships and every time I attempt to delete the column in one of the tables, it tells me...
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9961
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.