Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and the great PAGE FAULT
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00135048
Message ID:
00135085
Vues:
10
>I have a form that has a private datasession, in the load method of the form I make a call to a method of my application object to open a table in the current data session. e.g.
>
>oApp.OpenTable('CODE40','SIR','sir_ndx',.F.,.F.,lnDataSession)
>
>where CODE40 is the system, SIR is the table, sir_ndx is the tag to set, .F. I dont want exclusive open, .F. I dont wnat a new area to open table in (no select 0), and lnDataSession is the numeric value from the SET('DATASESSION') command so the method will open the tables in the correct datasession.
>
>The first time the form loads everything is fine, but when I close the form and open it again I get the very usefull message this program has performed an illegal operation and the details show a page fault.
>
>If I remove the call to the oApp and manually open the tables in the load event I have no problem opening and closing the form.
>
>Any suggestions?
>
>TIA


Through several layers of testing I came to the conclusion that you should not run the command SET DATASESSION TO lnDataSession from a method called by the load method of a form. I modified the base form class and added the OpenTable method, removed the datasession parameter and any datasession code. It works fine now, but I really dont understand why I could not do this from another object that was created n the main program. Hope this helps someone in the future.

Bret
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform