Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to reference DE of Form
Message
De
01/05/2003 13:21:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/05/2003 12:57:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00783748
Message ID:
00783765
Vues:
17
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>How can I reference the default DataEnvironment of a form? The VFP8 help for DataEnvironment object left me to believe I can do it this way but this does not work:
>
>oForm = createobject('form')
>? oForm.DataEnvironment.Name
>
Ramil,
If you use CreateObject() form doesn't have a dataenvironment object (It's a property referencing to an object).
Public oForm
oForm = Createobject('form')
oForm.AddProperty('Dataenvironment',Createobject('Dataenvironment'))
With oForm.DataEnvironment
    .CloseTables
    .Newobject('Cursor1','cursor')
    .Cursor1.Database = 'c:\myPath\testdata.dbc'
    .Cursor1.CursorSource = 'employee'
    .Cursor1.Alias = 'myEmp'
    .OpenTables
Endwith
With oForm
    .Newobject('grid1','grid')
    .Grid1.RecordSource = 'myEmp'
    .Grid1.Visible=.T.
    .Show
Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform