The information in this article applies to:
- Microsoft Visual FoxPro for Windows, version 3.0
SUMMARY
You can use a Private Data Session in Visual FoxPro as one of the
properties of the form. This will allow two sessions of the same form to
run with a separate record pointer in each instance.
MORE INFORMATION
To create a Private Data Session in a form, follow these steps:
- Type the following command in the Command window, and press the ENTER
key:
Create Form test
- Using the right mouse button, click the form, and select Data
Environment.
- Using the right mouse button, click the Data Environment, and select
Add.
- Select the Other option in the Add Table or View dialog box.
- Select the Customer table from the \VFP\SAMPLES\DATA directory.
- Drag the Company field from the Data Environment to the form. Note that
the control source property should be Customer.company.
- Choose the push button option from the form controls toolbox.
- Go to the click event of the push button and double-click. Type the
command Skip, and press the ENTER key. Then type the command
Thisform.Refresh, and press the ENTER key. Close this window.
- Go to the properties dialog, and select Form1 as the object. Then
select the DataSession property, and change to Private Data Session from
Default Data Session.
- Save the form. Then run it by typing the following command in the
Command window:
Do Form Test
- Execute the same command again, and use the push button to move in the
table. Note that the record pointer is positioned in a completely
different position in the separate sessions of the form.
Change the DataSession property back to default and run two sessions of the
same form and note the difference in the movement of the record pointer.
|