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!

debugger anomaly

Status
Not open for further replies.

BHarris

MIS
Joined
Apr 21, 2003
Messages
2
Location
US
I have a problem with my debugger in reference to deleting a record that has related records which have also been deleted. I am writing a vb program for a wedding guestlist database. There is a table for each family and a related table for family members, connected by the family ID. I am using an ado control to connect my vb program to Access. The problem is that I am receiving an error message when I try to delete a family record. It says there are related records in the member table. But before I delete the family record, I go through each related member record and delete it. The database shows that the member records have all been deleted when the family record deletion is attempted.
When I use the debugger to step through the deletion section, the program does exactly what it is supposed to do and deletes the family record (and related member records) just right. But when I run the program straight through, I get an error message at the point of deleting the family record. This makes it very hard to figure out what the problem is!
Have any of you had a problem such as this, with error messages when run, but perfect performance using the debugger? Please help!
 
Might be a timing problem.

Stepping through using the debugger inserts delays.
 
Yes. Do you know how to fix it? There is nothing in my program that overtly calls for timing.
I tried putting in a loop just to waste time until the related records were deleted, but it didn't help. I thought Visual Basic went through program steps one at a time, anyway.
 
Have you built in the Refential Integrity rules into the Database ?

If you set the main table to Cascade Deletions, you only have to delete record in the main table - all related records will automatically be deleted by the Database engine.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top