Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function to return what VFP will do to my code?
Message
 
 
À
14/01/2019 08:44:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01664494
Message ID:
01665376
Vues:
61
>>>>Either use the SAFE SELECT technique,
>>>>query to a second cursor
>>>>then zap your grid's cursor
>>>>append into the grid's cursor from the second cursor
>>>>
>>>
>>>"SAFE SELECT" - a phrase that makes me smile whenever I see it :) Since there is a "SAFE" select, there should be the "UNSAFE" version of it? If so, what is that? I always thought selecting was safe.
>>>
>>>The process you describe for "SAFE" in the above is actually done simpler and I never thought to call it "SAFE":
>>>
>>>-(Save grid recordsource) and set it no null or empty string
>>>-Query into that recordsource cursor or any other cursor you like
>>>-Restore the recordsource
>>
>>This does not work if you have some other objects added in the grid, like checkboxes etc. The grid gets completely messed up after re-setting the recordsource.
>>
>>My experience is to create a grid class with all relevant settings and instantiate them on the fly.
>>
>>1. Destroy grid (REMOVEOBJECT)
>>2. Select into cursor
>>3. Create gridobject (NEWOBJECT)
>>4. Set recordsource
>>
>>Nice thing, if you have similar or same grids on different forms, you don't need to duplicate code, but instead instantiate them on the fly from the same class or subclass.
>
>Christian,
>I have been using like that maybe since VFP5, and it does work, with no messing up (but I don't use VFP9 SP2, that one might be messing).

In some grids I can reproduce it. what happens is that when resettng the controlsource, it kind of shifts and the data is not anymore aligned to the columns. This happens by itself without doing anything except set RecordSource = "" and then filling again the original recordsource, even if the cursor itself has not changed at all.

See Screenshot, above before, below is after resetting the recordsource.

This happens only with grids that have a lot of functionality.
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform