Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View Puzzler
Message
De
24/07/1998 08:51:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00119767
Message ID:
00120935
Vues:
26
Hi Peter ---

In general, if the view is buffered, new records will be posted with TABLEUPDATE. Make sure the View property "SendUpdates" is set True.


>Thanks again it worked fine, one last request for info today, if you add records to a view and issue a tableupdate will they be picked up by the SQL update and update the base table?
>Regards
>Pete
>
>
>>Hi Peter ---
>>
>>By Page do you mean a Form or a PageFrame page? If you mean Form, there is no way using VFP commands that I am aware of. If a Pageframe page, sure...just change the ForeColor and BackColor properties as you see fit...either through a variable or property setting, in which case you may want to stick the code in the Refresh() method of the Page --or--- in the Click method of a control...etc.
>>
>>
>>
>>>John,
>>>I followed your advice and it works but I'm still at a loss as to why my original setup also works!, However I'm so impressed with views, that I now have to rewrite the app using views throughout. BTW do you know if there's a way to dynamically change the colour of the font in a page caption?
>>>Regards
>>>Pete
>>>
>>>>The uniqueness of the key counts for a lot....try assigning a primary key to the child table (it's own primary -- in no way connected to the parent) and use that as the updated key and see what happens...lemme know.
>>>>
>>>>
>>>>
>>>>>John,
>>>>>all the settings are set as you specify, but the field marked as the key is not unique as it's a child table
>>>>>Pete Kane
>>>>>
>>>>>>Peter ---
>>>>>>
>>>>>>I don't see anything wrong with that statement. So, if you update -any- record all records get the change? Hmmmm...OK... in View Designer, are the following settings true:
>>>>>>
>>>>>>Send SQL Updates = Checked
>>>>>>SQL WHERE clause includes = Key and modified fields
>>>>>>Update using = SQL UPDATE
>>>>>>
>>>>>>
>>>>>>Now, most importantly, in the field list of fields to be updated, is the field marked as the key unique? It should be.
>>>>>>
>>>>>>
>>>>>>
>>>>>>>John,
>>>>>>>thanks for the reply here is the SQL ;
>>>>>>>SELECT *;
>>>>>>> FROM employee!elements;
>>>>>>> WHERE Elements.clm_ref = ?thisform.clm_ref.value
>>>>>>>Thanks again
>>>>>>>
>>>>>>>>Hi Peter ---
>>>>>>>>
>>>>>>>>What is the SQL statement that comprises your view? Also, are you using GROUP BY option in that statement? You can load the View Designer and right click, choose View SQL to see what the actual SQL statement is.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Hello All,
>>>>>>>>>Today I created my first view ( local ), to my amazement it worked pretty well straight away. It is bases on a single VFP table and is parametised, ?thisform.clm_ref.value. I set the update criteria to update all & Perform SQL updates and accepted the default check boxes. From within the form I issued a Tableupdate(1) with buffering set to Optimistic Table. All my changes were written to the base table without a hitch ( I tried this several times ) I like these views thought I, then I don't know what I did but!!, if I now edit a field in a single record in the view ( not the primary key ) all the records in the base table ( with the same key ) inherit this change in value.
>>>>>>>>>e.g
>>>>>>>>>1)I enter E10126 in thisform.clm_ref
>>>>>>>>>2) Requery('myview')
>>>>>>>>>3) The grid has three records in it
>>>>>>>>>4) I change one field value in the first record
>>>>>>>>>5) I issue Tableupdate(1) ( the status bar reads 3 records updated )
>>>>>>>>>6) I issue Requery('myview') to see the changes
>>>>>>>>>7) All the records have inherited the change.
>>>>>>>>>
>>>>>>>>>I created another view using a different table ( using the same commands as above )and all is fine, what have I done wrong?
>>>>>>>>>TIA
>>>>>>>>>Pete Kane
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform