Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataEnviroment used in code
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00045232
Message ID:
00045234
Vues:
30
>I'm trying to use the tables attached to a forms dataenvironment in the procedures. I've discovered that I need to refer to them by number, and have used the original numbers from the 'cursor' names. The documentation for this stuff is non-existent and no examples that I've been able to find so far. I've even gotten a couple expensive books that haven't been much help.
>
>Now I'm trying to use the indices. I added an index 'tag' in the data definition for one of the tables in the dataenvironment cursor object. I've coded it into my procedure as a number, but now I'm getting an error message, tag not found. Any and all clues will be acted upon. Thanks


Chris, I'm not clear why you're using numbers. Each DataSession is assigned a number (#1 is you default datasession, #2 is the first private datasession, etc.)

Tables should always be referred to by their aliases. If you don't assign an alias, VFP will default to your table name. The DataEnvironment in each form calls them 'cursor1', 'cursor2' etc., but that is NOT the format you need to use in your code.

If all your tables use CDX indexes, then these are opened automatically when the table is opened and you just set the index tag with SET order to TAG MyTag. In any case, you refer to the tables in your code by their aliases. The initial index tag can be set in the DataEnvironment. Just click on the table, and when it is highlighted click on the Data tab of the Property sheet. You'll find the property 'order' with all you index tags listed for that table.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform