Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prob with SESSION CLASS and SET RELATION TO
Message
De
17/02/2001 12:17:56
 
 
À
17/02/2001 11:33:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00476971
Message ID:
00476999
Vues:
22
David:

The problem is in the second session subclass (instantiated in the first session subclass). For the purpose of this example, apart from the instantiation, we can largely forget about the first session class. All tables of interest are in the second data session subclass.

The SET RELATION TO relationship is defined in the second session class. I have a bordereau table (Bx), a Sales table (Sl), and a Client table (Cl). The Sl & Cl table's order is set to "cID", the PK of each table. The relationship is defined as follows:

Select Bx
Set Relation To cSalesId into Sl
Set Relation To cCliId into Cl Additive

At a point in the process, I issue the following command:

=Seek(m.cBxId,'Bx','cID')

The pointers in Sl & Cl just don't move. If I open the tables in browse windows and then run the above code, the same thing occurs but, if I physically select (click on) the Bx browse window, the SET RELATION TO command works and the pointers in the child tables move.

Just to be clear, if I issue the following :-

If Seek(m.cBxId,'Bx','cID')
If Seek(Bx.cSalesID,'Sl','cID')
If Seek(Bx.cCliID,'Cl','cID')
m.lAllFound = .T.

The pointers in the child WA's move just as expected. This is therefore a work-around, but something as basic as the initial operation should work as advertised.

So, what is peculiar about this scenario? The data session subclass was instantiated from within another data session subclass. I am trying to use a SET RELATION TO command structure inside a data session subclass. Doesn't seem like a big deal.

Originally, I was creating a reference to an instance of the SESSION class like so.

m.oHistData = CreateObject("Session")
SET DATASESSION TO (m.oHistData.DataSessionID)

However, to ensure that this was not a problem, I created a subclass as follows:-

Define Class HistoricData As gwSession
Enddefine

and put all code referencing the second data session in the HistoricData class, thereby ensuring that any reference to the data was handled through the HistoricData object.

If you have a further take on this, I would be very interested in you thoughts. Thanks for replying - it is appreciated.

Best

-Gary
-=Gary
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform