PRB: Send SQL Updates is Checked but Data Not Saved
ID: Q164387
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 6.0
SYMPTOMS
When adding a record to a remote view, sometimes the record does not appear
in the table after updating. Or the following error may occur when trying
to close the view:
Table buffer for alias <view name> contains uncommitted changes
Even though the "Send SQL Updates" box is checked in the Update Criteria
tab of the view, make sure that the Updateable (marked with a pencil
symbol) column for the primary key is checked also.
STATUS
This behavior is by design.
MORE INFORMATION
Depending on the rules that are applied to a table, many times a rule
requires that the primary key field of a new record must have a value
placed into it before the record is saved.
It is often assumed that while in the Update Criteria tab of the View
Designer, selecting a primary key field in the Field Name list box and then
clicking the Update All button updates the primary key and all other fields
in the list box. This is not entirely true; while all of the other fields
have the Updatable column (marked with the pencil symbol) checked, the
Updateable column of the primary key is not checked. It has to be checked
manually in order for the primary field to be updated. If the primary key
field is not checked, this causes the record not to be added to the table.
Steps to Reproduce Behavior
- Open a database.
- From the File menu, click New. Click Remote View and click New.
- Select a connection or data source in the list box and supply the
correct information to connect.
- Add a table from the list box.
- In the Fields tab, select all records.
- In the Update Criteria tab, check the Send SQL Updates box and make sure
that there is a primary key checked. Click Update All to select all of
the fields to be updated.
- Run the view and click Append New Record from the Table menu.
Add data to the fields and close the Browse window.
- Close the view after naming it; reopen and run it. Note that the record
that you added is not there. By going into the View Designer and
checking the Updatable column on the primary key field, a record can now
be added to the table. Note that if the table that the view is created
on does not have rules that the primary key field must have a value in
it. It is then possible to add a record but the primary key field is
left blank.
Additional query words:
Keywords : kbVFp kbVFp300 kbVFp300b kbVFp500 kbVFp600 FxtoolQueryvwdes
Version : 3.0 3.0b 5.0, 6.0
Platform : WINDOWS
Issue type :