Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid
Message
De
29/08/1998 14:22:19
 
 
À
29/08/1998 08:56:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Re: Grid
Divers
Thread ID:
00131252
Message ID:
00131282
Vues:
16
>>>I need to populate a grid from a SQL-SELECT with a UNION then be able to update that data then append parts of it to a table. What method can I use to do that? I have discovered that a cursor is read only so that won't do. I am kinda stuck...
>>>
>>>Thanks
>>
>>Hi John -
>>
>>Try using an updatable view - it's like an updatable cursor. The view is stored in your DBC. There is a view designer that can help you with the simple views and then you can modify it outside the view designer for more complex views (i.e. for unions, joins, etcs.). There are a lot of threads on this topic, so you should be able to get some good info.
>>
>>Sylvia
>
>How do you modify it outside of the view designer?
>
>THanks

John -

After creating a basic view in the view designer, I ran the DBC generator (Gendbc - should be in your Tools directory under VFP), which creates a 'text' or program version of all the code used to create the DBC. Then I searched for the code which created the view, e.g. CREATE SQL VIEW...etc. I copied this to another .prg file (so as not to screw up anything in the original file), then modified the SQL used to create the view, and any of the updatable properties. I did a lot of testing when I was learning this, but it was very helpful in seeing the behind the scenes stuff. Anyway, after I was confident of my changes, I deleted the old view from the DBC (I believe the command is MODI VIEW and it shows all the views in the DBC) and then ran this code to recreate it in the DBC with my changes. If you don't like the results, you can repeat the process.

By the way, an advantage of having that Gendbc code is that if you really mess up, you can use it to recreate your entire DBC.

Sylvia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform