Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Rafiq Ahmed
  Where is Rafiq Ahmed?
 Islamabad
 Pakistan
 Rafiq Ahmed
 Tags
Subject: RE: visual foxpro comparison and master child relationship
Thread ID: 112256 Message ID: 112257 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Monday, November 06, 2006 7:58:12 PM         
   


> Hi Experts,
>
> I wana know two things about.
>
> 1. Is there any comparison document showing Visual Foxpro with Other Language. That clearly shows Visual Foxpro 9 better than other dev. tool.
>
> 2. I am stuck up as. Scenrio is
>
> Sele a
> Use Table master
> Set order to 1
> Sele b
> Use History
> Set Order to b
> Sele a
> Set relation to pp_no into b additive
>
> That is places on a with master child relationship as grid1 controlsource history.
> My concern is that
> If I access a record with one child and that child is deleted through a button code.
> After deleting that only single record from b I fire following code.
> ?found('history) will still showing .T. while all child record is deleted(set deleted on). What I want is after deleting all records from child will check the grid with no record then disable delete button.
>
> IS there better solution to achieve this.
>
> Tbanks in advance


Rafiq,

I haven't seen you here before, so welcome to Foxite.

1. Is there any comparison document showing Visual Foxpro with Other Language. That clearly shows Visual Foxpro 9 better than other dev. tool.

For datacentric applications, VFP is about the best that you will find. It is blazingly fast, inexpensive and with a VERY robust development environment. I am certain that other members will back up my claim. If you are looking for documentation on this, Take a look at http://www.tiobe.com/index.htm?tiobe_index. Every time I look at this, I find VFP shown as increasing in popularity.

It sounds as if you are becomming frustrated and if that is the case, join the crowd. We have all been frustrated from time to time. That does not mean that we are willing to throw away VFP.

As to your problem,
USE Master IN 0 SHARED && Use Table master ???
SET ORDER TO TAG MyTag IN [Master] && use the tag name rather than the order number
USE History IN 0 SHARED 
SET ORDER TO TAG MySecondTag IN [History] && again, use the tag name
SET RELATION TO Master.pp_no INTO History ADDITIVE IN [Master]

Note the use of IN 0 SHARED. This tells VFP to USE the table in an unused work area. From that point on, you can use the IN clause (see the SET ORDER & SET RELATION commands. Also, note the use of the alias as a prefix to the pp_no field in the SET RELATION command. This tells VFP where the field is located.

The type of code that you show is typical of most beginners. You have read about work areas and you know that they are aliased with A, B, C ... but you can also set your own alias as well. If you simply USE MyTable IN 0, VFP will create an alias based on the table name for you. Forget about selecting a specific work area - too much like work and effort trying to keep track of what table is open in what work area. Just use the table alias and it is much simpler.

Note also the use of the tag name. I haven't a clue as to what order "b" is. When you create your index tags, give them descriptive names and use those names. SET ORDER TO 1 tells VFP to use the first tag, but what is that tag? Again, use a descriptive tag name. In a year or so, when you have to modify this code, you will be very glad that you did.

Give this a try and come back here with more questions if you have to.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

visual foxpro comparison and master child relationship Posted by Rafiq Ahmed @ 11/6/2006 6:59:33 PM
RE: visual foxpro comparison and master child relationship Posted by Ken Murphy @ 11/6/2006 7:58:12 PM