Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you suspend referential integrity during a transaction? 1

Status
Not open for further replies.

dalchri

Programmer
Apr 19, 2002
608
US
I've got a lookup table called Payments that I need to refresh from a master database. I've been doing this by dumping the entire table and the inserting the rows from scratch.

The problem is that there is a relationship with the Orders table and I can't delete the records in the Payments table without violating that relationship.

At the end of the transaction, after the delete and the inserts, referential integrity ought not to be violated.

Is there a way to do this without having to resort to locating each record and updating if necessary, inserting if the record doesn't exist, or deleting a record that has no match?

The master database is MySQL so I don't have the ability to use any of the replication functionality built into access.
 
dalchri,

Hmmmmmmmm I see why you wish to do this. Warning! Make sure no one else is in the MDB when you do.

Although I have not done this, try taking a look at Access Help on Relations Collection and Relation Object. You should be able to build code using the examples.

Also here is some reference (not exactly the same thing) Microsoft

I hope this will help...


Good Luck....

[thumbsup2]



 
You ought to be able to do this with SQL. Have a look in Help - Microsoft Jet SQL Reference->DDL->Constraint Clause.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top