Hi Tom,
Try this:
in the init event of your form or whenever you asign the data to your grid:
* Reset your grid's recordsource (this is important)
ThisForm.grid.RecordSource = ""
* Create the cursor:
SELECT * FROM MyTable INTO CURSOR MyCursor
* Assign the cursor to your grid:
ThisForm.grid.RecordSource = "MyCursor"
* Refresh it!
ThisForm.grid.Refresh()
You must have the grid.RecordSourceType = 1.
Hope this helps.
>>>Is there an easy way to make a Grid display a
>SQL
>>>cursor???
>>>
>>>Tom
>>I assume you mean programmatically and not from
>>the command window. I've found that setting the
>>grid.RecordSourceType = 3 (Query) and
>>grid.RecordSource to the name of the cursor
>(being
>>careful to have the SQL code already saved in a
>>QPR file of the same name), to be effective.
>>Also, have the grid.ColumnCount set to -1 to
>>accept all fields.
>>Is this what you were looking for? 8-)
>
>
>Michae
J. Luis Santiago Rodríguez.• CADIS • E-mail: jlsantiago@iserve.net.mx• Ciudad de México.