Delete Records from Linked Primary Table Only

  • Thread starter Thread starter Tonymac12
  • Start date Start date
T

Tonymac12

How can I delete records from a link primary table without deleting records
from related tables?
 
Not exactly clear what you are aiming for.

Using Northwind as an example, you want to delete a customer, but not delete
their orders? If so, it is possible to programmatically set up the relation
between Customers.CustomerID and Orders.OrderID so it has a Cascade To Null.
When a customer is deleted, the CustomerID in Orders table becomes Null, so
it does not have the deleted CustomerID, but the information about the order
is not lost. This is only possible in JET 4 (Access 2000 and later).

If that's what you are wanting to do, you will have to create the relation
programmatically using ADOX. The interface cannot create or identify this
kind of relation. Post back if you need details.
 
I am using a linked table to get customer name and ID number for tables in a
2nd Database. I do not want to delete customer info in the 2nd DB when I
delete the customer name and ID number in the linked table. The DB is Access
97.
 
If the two tables are in different mdb files, there is no relational
integrity enforced between the two. No cascading deletes. No integrity
checks. You can delete from one table without affecting the other.

Seems like I'm not understanding the issue here.
 
There is a lookup table that has relational integrity enforced with the linked
table. When I delete customer info from the linked table the customer info is
deleted in tables in the 2nd database.
 
There is a lookup table that has relational integrity enforced with the linked
table. When I delete customer info from the linked table the customer info is
deleted in tables in the 2nd database.

This will happen if you have checked "Cascade Deletes" in the
relationship window. Uncheck it if you want to have the customer info
kept.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top