Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Views , parent child relations and data forms.
Message
From
16/04/2001 09:20:11
Fausto Garcia
Independent Developer
Lima, Peru
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00495647
Message ID:
00495740
Views:
8
Hi Hiten,

Think on VFP views as dynamic elements that get their content from one or more local or remote tables. If you modify, add or delete records on the base tables, the view will show you updated content.
You can also update, add or delete records on a view, but you have to configure it if you want to apply this changes to the base tables and make them updateable. Views that have this ability are called "updateable views".
There are some default rules that apply to updateable rules, for example:
- you can update all the tables contributing to a view that have a primary key;
- all fields in updateable tables are updateable except the primary fields.

In the specific case of your example, adding or modifying records on the view will not cause any effect unless you make the base tables updateable. You can do so opening your view with the View Designer:
- First of all define a primary key on your base tables;
- Open the View Designer and go to the "Update criteria" page;
- Select wich tables and fields will be updateable (place a check on the corresponding button under the pencil icon for each field);
- Select the SQL WHERE clause (typically set to "Key and modified fields");
- Select the update method ("Update using", use SQL UPDATE for testing purposes);
- Make sure to select the "Send SQL updates" checkbox (updates won't be saved unless you do this).

You can also set up your view's properties programmatically with the DBSETPROP() function. Miriam Liskin wrote an article that was published on the january 1998 issue of the FoxPro Advisor magazine.
For further info check also the VFP documentation on views or feel free to ask for more detailed help.

HTH,

>Hello
>
>I have a question about views.
>Since views are updateable, I wanted to know a few things about views.
>
>I have a Orders table
>
>nOrderNo
>cCustomer
>
>I have a OrderDetails table
>
>nOrderNo
>cItem
>nQty
>
>I have a updateable view with the sql like this ..
>
>Select Orders.*,OrderDetails.* from Orders Left Join OrderDetails on Orders.nOrderNo = OrderDetails.nOrderNo
>
>Now if I append a record to this view what all is happening internally ?
>
>I need some very good documentation on views.
>
>Any sugestions ?
>
>Thanx in advance .
Solo se que nada se

Fausto J. Garcia Pino - MCSD.NET
.NET, Oracle, Tronador & Fondismo!
Previous
Reply
Map
View

Click here to load this message in the networking platform