Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to many form using a local view
Message
De
24/04/2004 11:33:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00897811
Message ID:
00897911
Vues:
15
IMO, you need views mainly for the following reasons:

1) Parameterized views for fast access to a small subset of a large table.

2) Remote views for a database server.

3) Abstraction of the data source. I have seen this in some version of the CodeBook framework: The idea is that you can quickly change between local data and a database server. You might have a separate copy of the database, for instance.

I don't know whether views would help reduce data corruption; to reduce data corruption, I would suggest two precautions: 1) Use the command FLUSH after saving a record with TableUpdate(). 2) Turn off write cache on the hard disk.

>Hi Hilmar,
>
>Thank you for the useful tip, it is working out for me.
>
>I have another question for you or to anyone. One of my forms is a very complex tabbed form, with many source tables behind it. Would you recommend basing the form entirely on local views, instead of using the tables directly?
>
>In the past, I've primarily used my tables for the source of my forms. However, I'm wondering if there are benefits to using local views instead of tables as a form source (such as faster performance, more efficient multi-user performance/design, less risk of table corruptions, etc.). I've been reading through some VFP 8.0 documentation, but have not yet found any extensive information regarding the advantages and disadvantages of using local views instead of tables as form sources.
>
>Dave
>
>
>>One option - and the best for speed and flexibility - would be for the child grid to be based on a parameterized view. A parameterized view will show only the records that fulfil a certain condition. The condition, of course, would be coincidence with the value of a parent record.
>>
>>>Hi,
>>>
>>>Is there an "easy" way to set up a one to many form, where the grid has a local view as its source, and the main form is based on a parent table? I've tried this with the grid builder, but it won't allow me to set a related index for the child table (which is included in the local view in this case). Although, I realize that a view is a form of a query, and not really an actual child table (which is probably the problem).
>>>
>>>I have included the local view in the data environment of the form, but the grid builder's "related index in child table" combo box is empty with no selection options. I'm able to set the key field in the parent table, but that is all.
>>>
>>>Any help on this would be appreciated.
>>>
>>>Dave
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform