Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ravi Taxali
  Where is Ravi Taxali?
 Markham
 Canada
 Ravi Taxali
 To: Tai Nguyen
  Where is Tai Nguyen?
 
 United States
 Tai Nguyen
 Tags
Subject: RE: code to mark for delete
Thread ID: 228441 Message ID: 228784 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, May 21, 2009 4:00:27 PM         
   


> I wrote a program to do this before and I can't find that program again. Basically, I will have 2 tables called Table 1 and Table2.
>
> USE "c:\Table1.dbf" AGAIN IN 0 SHARED
> USE "C:\Table2.dbf" AGAIN IN 0 SHARED
>
> Select training
>
> Goto top
>
> SCAN FOR DELETED()
>
>
> DELETE FROM Table2 WHERE RECNO("Table2") = RECNO("Table1")
>
>
> ENDSCAN
>
>
>
> Table1 and Table2 are the same structure and data. The code will read what record numbers have been deleted in Table1 and mark delete for the same records in Table2.
>
> Thanks,
>
> Tai Nguyen.

Deleting or processing records on RECNO() is not considered a good idea. It is preferred if each of your table has a primary key and you delete records based on presence or absence of the corresponding record in the "other" table.

- Ravi Taxali
Visual FoxPro Made Simple -- An excellent book for beginners as well as experienced programmers

ENTIRE THREAD

code to mark for delete Posted by Tai Nguyen @ 5/18/2009 11:48:01 PM
RE: code to mark for delete Posted by Ammar Hadi @ 5/19/2009 12:51:30 AM
RE: code to mark for delete Posted by Tai Nguyen @ 5/19/2009 3:30:02 PM
RE: code to mark for delete Posted by Ammar Hadi @ 5/19/2009 3:44:52 PM
RE: code to mark for delete Posted by Tai Nguyen @ 5/19/2009 7:26:48 PM
RE: code to mark for delete Posted by Ammar Hadi @ 5/20/2009 10:57:07 AM
RE: code to mark for delete Posted by Tai Nguyen @ 5/20/2009 5:02:37 PM
RE: code to mark for delete Posted by M. Akram Bhatti @ 5/19/2009 6:54:22 AM
RE: code to mark for delete Posted by Tai Nguyen @ 5/19/2009 3:34:09 PM
RE: code to mark for delete Posted by Ravi Taxali @ 5/21/2009 4:00:27 PM