Information générale
Catégorie:
Gestionnaire d'écran & Écrans
WOW, Elyse - who would ever have guessed!!!
I'll file that one for sure.
Cheers,
Jim N
>>One of the subtle things that is happening is that the requery is reissuing the query select statement creating a NEW cursor that is almost like the previous but not quite. By this I mean that the grid is bound to the first query data not by name (although it appears that way) but by an internal file handle. The requery that re-executes the select statement creates a NEW cursor with a new internal file handle and deletes the old one. Your grid is now bound to something that does not exist!
>>
>>There are two ways around this. Just before the requery say grid.recordsource = SPACE(1). do the requery and then set the record source back to the cursor name.
>>The other method is to create a view of the data you want (using a parameter if you need to limit the data returned.) Set the grid recordsource to the view. The requery of the view does not issue a new select statement (at least not in a way that changes the internal handle)
>>
>>Bob
>
>After much work, I found the problem. One of the fields in the SQL used the DTOC() function. The problem arose when the view was opened with CENTURY set OFF and then REQUERY() with CENTURY set ON (or vice versa). Since the length of the field changed (and hence the structure of the view), I got the message about the view definition having been changed. The solution is to PADR() the expression so it is always a constant length. Thanks anyway...
>
>Elyse
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement