Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Requery a 6.0 Grid
Message
 
 
À
21/03/2000 03:57:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00347821
Message ID:
00348521
Vues:
30
Hi Marcia,
>
>>> Is there some way to requery a 6.0 grid without having to re-define grid properies? <<
>
>The easiest way to do this is to define a parameterized view and use that as the RecordSource for your grid. Thn, when you have to change the grid's contents, you just Requery() the view with a different paramter.
>
>Another technique that I use is what I call a "safe" select. I define an updateable cursor in the form load and use that as the RecordSource of the grid. Then, when I want to requery the grid's contents, I zap it's RecordSource, do a SELECT into a temporary cursor, and append from the temporary cursor into the grid's RecordSource. Zapping the grid's RecordSource will not reset the grid because it does not close the RecordSource.
>

Thanks for this technique. I've just implemented it. I think, it's important to empasize, that you should use this syntax in append command:

append from (dbf('myCursor'))

append from myCursor doesn't work (I spent some time before I understood this problem).

This is an example, how I implemented your idea:
********************************************************************
*  Description.......: multiSelectGrid.GridInit
*  Calling Samples...: 
*  Parameter List....: cSql
*  Created by........: 
*  Modified by.......: Nadya Nosonovsky 03/21/2000 12:34:14 PM
********************************************************************
lparameters cSQL
thisform.lockscreen = .t.
cSQL = stuff(cSQL,atc(" from",cSQL),;
	0,",.f. as lSelected,.f. as lLastSelected,recno() as rcno")
cSQL=cSQL+' into cursor myCursor'	
&cSQL
select (this.AliasName)
zap 
append from (dbf('myCursor'))
if used('MyCursor')
  use in mycursor
endif  
thisform.lockscreen = .f.
Thanks again.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform