Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding tables to a custom DE object
Message
 
À
05/10/2001 11:05:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00564785
Message ID:
00564811
Vues:
21
>>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

Thanks a lot. It worked.

Enmanuel
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform