Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamically adding tables to data environment, VFP 7
Message
 
 
To
30/01/2002 12:06:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00612858
Message ID:
00612891
Views:
27
Look at:

ThisForm.DataEnvironment.AddObject('crsTable1','Cursor')

Once you do that, you can specify the properties like CursorSource, Alias, etc.

In the VFP Help Index, search for DataEnvironment. Double-click on it and select the DE Object from the list. In See Also you can find info on the Cursor and Relation objects.

For the DE, you will want the AutoOpenTables set to false, then call the OpenTables once you have added all the cursor and relation objects you need to the DE.

>I am generilazing an application. Part of this process is to define a working direcotory (folder) on a departimental basis. I do this by reading the value form a table. I assign the value to a global variable (yes I know a property is better but that would involve other changes I do not want to tackle yet). Current several forms point to free tables in the working direcotory. Call the global vairable gcWorkdir. How do I dynamically open tables for the forms data enviroment when the form starts up and then assign properties to the table and set relations? For example in one form I want to use the table PIORIDERS in folder workdir7 (value of gcWorkdir) in Exclusive mode and have the field cstkno in table INSTOCK joined (set a relation) to field clstkno in table PIORDER. In other form I want to open table VORDTMP and set its tag to field cvendcode. Currently relations are set in the INIT method of the data enviroment in one form and hard code (diagram) in the other. Can it all be
>done in the INIT method? If so please post sample code. TIA
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform