Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select-sql results to grid
Message
De
14/01/2000 04:04:50
 
 
À
14/01/2000 03:52:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00318072
Message ID:
00318074
Vues:
19
Hi Ellai.

>> This is the scenario: There is grid in a form and a command button. The comman button contains a select-sql command which filters a certain table.
I want the result of that selection to be directed to the grid when i press the button. Is there a way to this. <<

Sure. Quite a few. If the structure of the result cursor stays constant, my preferred approach is to define an updateable cursor in the form's load using CREATE CURSOR to use as the grid's RecordSource. Then, after you do your SQL SELECT into a temporary cursor, you ZAP the cursor you are using as the grid's RecordSource and append from your temporary cursor.

Otherwise, you can so something like this:

Thisform.MyGrid.RecordSource = ''
SELECT Yada, Nada, Blah, etc. etc. FROM SomeTable JOIN SomeOtherTable ON SomeCondition WHERE SomeOtherCondition INTO CURSOR GrdCursor
Thisform.MyGrid.RecordSource = 'GrdCursor'

Finally, you can look into setting up a parameterized view to use as the RecordSource for your grid.

Marcia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform