>Which is the best way to open tables, databases, views when loading a form? Using the DataEnvironment or the USE command in the LOAD method? How does each way compare to the other?
>
>Thanks in advance,
There are a couple of advantages to using the Dataenvironment.
1.
Speed - VFP opens tables and views faster if included in the Dataenvironment.
2.
Ease of configurability - When tables and views are included in the Dataenvironment, you can use drop downs to set ControlSources/RecordSources/RowSources. Otherwise, you have to type everything in manually and this increases the chances of errors.
The biggest advantage to using the USE command is it circumvents the Database property setting of Cursor objects within the Dataenvironment. What I mean by this is if you have two machines with the exact same directory structure and machine 2 has a path statement that points to machine 1, machine 2 will open the data from machine 2 because the relative path stored in the form will exist on machine 2. VFP checks for the hard coded relative path before it looks along the VFP PATH. The USE command looks along the VFP path. However, you can bypass this by changing the Database property in the BeforeOpenTables method.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao