Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select-sql results to grid
Message
From
14/01/2000 04:04:50
 
 
To
14/01/2000 03:52:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00318072
Message ID:
00318074
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform