Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids & SQL cursors
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00002374
Message ID:
00002459
Vues:
31
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform