Microsoft KB Archive/128393

= How to Create a Private Data Session in a Form =

Article ID: 128393

Article Last Modified on 2/12/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q128393



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.</li> 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.</li> 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.</li>  Save the form. Then run it by typing the following command in the Command window: Do Form Test </li> 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.</li></ol>

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.

Additional query words: VFoxWin 3.00

Keywords: KB128393

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.