Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table not getting updated?
Message
From
29/03/2000 15:05:03
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
To
29/03/2000 08:27:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00350459
Message ID:
00352329
Views:
28
Thanks John - it looks like that led me to the answer....and at first testing, it looks like it's fixed...here's what I found:

The things you mentioned to check ALL looked ok in the output from GENDBC() (cursor was updateable, etc.)...BUT I noticed something strange. I had a field in the SQL statement that called a UDF:

ShowYOrN(lActive) AS cActive

The props for that field looked "strange" - note the UpdateName property being set:
* Props for the MODIFYAGENCY.cactive field.
DBSetProp('MODIFYAGENCY.cactive', 'Field', 'KeyField', .F.)
DBSetProp('MODIFYAGENCY.cactive', 'Field', 'Updatable', .F.)
DBSetProp('MODIFYAGENCY.cactive', 'Field', 'UpdateName', 'Agencies.childxfrprice**')
DBSetProp('MODIFYAGENCY.cactive', 'Field', 'DataType', "C(3)")
I changed the field to include that table name:

ShowYOrN(Agencies.lActive) AS cActive

...that caused the UpdateName property to be changed to:

DBSetProp('MODIFYAGENCY.cactive', 'Field', 'UpdateName', '')

And now things seem to work better...will mess around w/it some more to be sure. Thanks for pointing me in the right direction.

"Should" this cause a problem? guess I'll get into the habit of always specifiying the table name in views, even if there is only a single table.

Or maybe this only happens to people over 50....(include me in that group)....thanks for your help. J


>If both forms are modal, then they can't be up at the same time, right? So when you add an agency in MaintainAgency and TABLEUPDATE(), when you close this form and open Reservations the new record should be there.
>
>It sounds to me like the base table is not being updated. This would explain why a new record appears fine in MaintainAgency and in any form launched inheriting the datasession with a Default datasession and would also explain why another private datasession that reopens the view doesn't have it.
>
>Jill, run the GENDBC() tool and look over the PRG it spits out. What you are looking for in the view definition for this view is if cursor Updatable is True and the Key column field is updateable. Also, if there is a Key column defined. Another common cause of these types of problems is if columns from more than one table are shown as updatable.
>
>Let me know.......
>
>
>
>>Yes, John, thanks - that's what I've always heard here and I have followed that advice...AND I'm having this strange thing happening...and am at my wits end.
>>
>>Maybe I can present my problem in a clearer way than I did before...anyway here goes:
>>
>>I have a table, Agencies.DBF, that has a primary key, CODE, and a description field, AGENCY (I know, I know, not much of a naming convention); there are other fields in the table.
>>
>>The table is updated via a view, ModifyAgencies, in a modal form, MaintainAgencies - which uses a private data session. MaintainAgencies can only be called from the menu from the "main" form.
>>
>>Data from Agencies.DBF is used in another form that is called from the main form, Reservation. It's used as the source for a combo for the user to choose an agency. This form is also modal, and uses a private data session.
>>
>>When I run MaintainAgencies and add an agency, all looks well...if I then go to the Reservation form, the new agency is not there.
>>
>>If however, if I run MaintainAgencies and add an agency and run a third form (that inputs the agency for which to generate a report), the new agency shows up...this form uses the Default data session.
>>
>>>Auggh!!
>>My feelings, exactly.
>>
>>Regards, J
>>
>>
>>>Jill, run screaming from having both open in the same DE. Use only the view. Let VFP handle the base table update. Do not explicitly open it in the DE.
>>>
>>>
>>>>I'm STILL having trouble with this and keep going back to your message.
>>>>
>>>>>I ran into something similar a while back that might be related to what you're seeing. Essentially I ended up having to call the tableupdate function twice. In my case I had both the table and the view in the DBC and for some reason this was what was needed to make sure the update made it all the way to where it was needed.
>>>>
>>>>You mean "both the table and the view in the " DE of the form? and you're updating via the view? I'm using optimistic buffering for the view...what do you set for the table?
>>>>
>>>>And you call the TableUpdate for the View twice? or once for the table and once for the view - in what order?
>>>>
>>>>TIA, J
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform