Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing The DataEnvironment
Message
From
30/09/1998 23:59:20
 
 
To
30/09/1998 23:18:22
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00142671
Message ID:
00142678
Views:
31
>When you create a form or a report with a DE, the CursorSource is
>entered by VFP. In addition, it is RO at design time, but RW at
>runtime. If you move the DBF to another directory the file can't
>be found and VFP issues an error.
>
>For the application I'm writing I have a setup screen which allows
>the user to enter the directory that various files are found in.
>I've been wrinting custom code in the BeforeOpenTables method to
>change the CursorSource.
>
>I'm wondering if it's possible to create a custome DataEnvironment
>class which could be automatically used with each form or report
>that I create.
>
> ...kt

Hi,
You could programmatically alter the cursorsource path in the load event of your form base class. You then do an Dataenvironment.OpenTables() in the Load.
That way you only have to write the code once.
You still have to remember to set Autoopentables to .f. in each DE, but that's easier than pasting code.
HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform