Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding tables to a custom DE object
Message
From
05/10/2001 11:05:21
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00564785
Message ID:
00564798
Views:
17
This message has been marked as the solution to the initial question of the thread.
>I got the following code:
>
>Thisform.addproperty("oDataEnv",createobject("Loadtables"))
>
>Thisform.oDataenv.addproperty(aTables(2),createobject("cursor"))
>With Thisform.oDataenv.(aTables(2))
> .cursorsource = aTables(2)
> .Alias = "Accounts"
> .Order = "Account"
>Endwith
>
>Thisform.oDataenv.Opentables
>
>This is suppossed to create a DE object and add a table from the array "aTables". The "oDataenv" container is created and the table object is added to the container but when I try to manipulate the data in the table I get an "alias does not exist" error message. Also when I try to access the data through the data session dialog in the main VFP window it doesn't appear in the window's data sessions list.
>
>Hope somebody could help me.
>
>
>Enmanuel

You can AddObject() the cursors that you will be using like this:
This.DataEnvironment.AddObject("myAlias", "Cursor")
With This.DataEnvironment.myAlias
	.Alias = "myTable"
	.CursorSource = "mrn.dbf"
EndWith
This.DataEnvironment.OpenTables()
Set the DE AutoOpenTables to .F. before this. I notice you have a custom DE, so just replace DataEnvironment with your reference.
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform