General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
General problem with updatable views VFP 7.0
I don't know if I am just handling views wrong but I am constantly having problems with updatable local views, especially losing the key field value in a view.
This is happening on views that are populated originally from an underlying table. I usually use optimistic table buffering (mode = 5) in my data environment, update the information in the view, call getnextmodified, then
tableupdate(1,.T.,'viewname').
For the most part this works but on more than one occasion (way too often) an update that worked perfectly fine, will stop working. I usually trace it to the key field in the view record being empty (so it doesn't know what record in the underlying table to update) even though when the view was created by Requery the key field had a value.
I have never been able to figure out exactly when or why it happens or what fixes make it work again. Usually my solution is to delete and recreate the view...that sometimes works. An other practice is to remove the view from the data environment and add it again...that sometimes works. Sometimes it takes several attempts and other guess work before the update begins working again.
I have also had problems with a record newly inserted into views where the keyfield doesn't update to the underlying table even though it does have a value and is marked as updateable in the view definition.
I always check to make sure that the underlying table is not buffered.
Has anyone had similar problems?
Ken
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only