Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible to use SELECT-SQL to build an empty cursor?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00271836
Message ID:
00273419
Vues:
20
The select could get fields from different tables. Therefore , the select...

>Why do you need the SELECT statement? Just create the cursor from the array populated by AFIELDS on the original table.
>>IF You have a select statement....
>>SELECT * FROM table where .F. INTO CURSOR _MyCursor
>>=AFIELDS(lafields)
>>CREATE CURSOR MyCursor FROM ARRAY lafields
>>USE IN _MyCursor
>>
>>Otherwise you will have to use a create cursor
>>
>>
>>>Here's my problem.
>>>
>>>I want to pass a parameter to a form that tells it how to build mycursor.
>>>
>>>The called form has a grid whose source is the mycursor.
>>>
>>>What I'd like to do is build mycursor in the Load, using the passed parameter so that the cursor exists when the grid's Init occurs.
>>>
>>>Unfortunately, VFP6 passes the parameter to the Init of the form ... which as you all know executes after the grid's Init. Thus, I cannot use the parameter in the load to build mycursor.
>>>
>>>My quick and dirty fix was to create a variable in the caller's scope that could be seen by the form at Load time. Not the best interface practice, but it works.
>>>
>>>Another approach would be to create an empty mycursor in the Load, so that it at least exists when the grid's Init fires, then populate the cursor in the form Init...so how do you create an empty cursor with the desired row/column format?
>>>
>>>Are there other commonly accepted ways to handle this situation?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform