Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid properties changes after recreate the table ?
Message
De
22/09/2003 12:03:32
 
 
À
22/09/2003 11:47:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00831131
Message ID:
00831141
Vues:
20
my grid's recordsource is a table i have created by code. when i recreate the table the grid appears with default properties of the grid. how can i correct it ?

You should not re-create the table. Instead, you should do what I call a "safe select". Basically, the idea is that you do a SELECT into a CURSOR, ZAP the grid's RecordSource, and then APPEND FROM DBF( 'MyCursor' ). Code similar to this (if you add a custom method to your grid class called ResetGrid):
SELECT ( This.RecordSource )
ZAP
SELECT Yada, Nada, Blah FROM SomeTable WHERE SomeCondition INTO CURSOR csrJunk NOFILTER
SELECT ( This.RecordSource )
APPEND FROM DBF( 'csrJunk' )
USE IN csrJunk 
GO TOP IN ( This.RecordSource )
This.Refresh()
Another alternative is to use a parameterized view for the grid's RecordSource and REQUERY it with the new parameter when you have to change the data in the grid.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform