Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Issuing A SQL Statement in a form
Message
De
24/08/2002 22:02:50
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00693320
Message ID:
00693375
Vues:
23
Hi Jim
Thank you for the excellent explanation. I guess I really was recreating the cursor. The query was the result of a series of totals from an accounts receivable table. The totals were made based on invoice number and then displayed in the grid. Because the cursor is read only, I used the keypress method to trigger the child form which is payment receipts form. The amount of the payment is then recorded in one of the tables that supplied the query, and I wanted to refresh the new amounts for the grid. I guess I really was recreating the cursor and therefore Sergey's logic worked well. Your explanation was very helpful. I think I understand it. At least when I record the cash payment and run the query again, the changes to the table are reflected correctly.

Regards,
Carmen
>Carmen,
>
>You only need to do the grid rowsource stuff when you are going to recreate the cursor that the grid is using.
>
>The reason you need to do this is that when you issue the SELECT ... command you are essentially putting a gun to the grid's head and pulling the trigger.
>
>You see there is this grid and its entire self identity is depending on the existance of the cursor. The grid is happily going along in life just as content as a bug in a rug. Then one day something just suddenly makes the cursor disappear, gone, no sign of it having ever existed. The poor grid is totally insane, it has no idea of who it is or where it came from. Its entire family history is gone. It has no idea how many columns it is supposed to have or what is supposed to be displayed in those columns. Why, because the first thing your SELECT command does is to destroy all traces of the cursor (this is when the grid loses its mind). Then the select command creates a new cursor with the same name as the old one but by then the grid has lost its mind totally.
>
>When you blank out the grid's rowsource before the SELECT is done you are disconnecting the grid from the cursor. Then you can run your SELECT and it has no effect on the grid because the grid is disconnected from the cursor. Once the SELECT is completed, and the cursor again exists, you can reset the grid's rowsource.
>
>Hope this is helpful.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform