Microsoft KB Archive/249836

= PRB: Table Buffer Contains Uncommitted Changes on REQUERY =

Article ID: 249836

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b for Macintosh
 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q249836



SYMPTOMS
The following error message appears when issuing a REQUERY command against a remote view:

Table buffer for alias contains uncommitted changes



CAUSE
This behavior occurs when a REQUERY command is issued against a remote view under the following conditions:
 * Optimistic Table Buffering has been enabled.
 * Changes have been made to one or more rows in the view.
 * A TABLEUPDATE or TABLEREVERT command has not been issued.



RESOLUTION
Issue a TABLEUPDATE or TABLEREVERT command before issuing a REQUERY command.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
  Create a program file named "BUFFDEMO" using the following code: CREATE TABLE test (Charfld c(10), Numfld N(10,4)) CLOSE ALL

CREATE DATA test CREATE CONNECTION testa CONNSTRING 'DRIVER=Microsoft Visual FoxPro Driver;' + ; 'exclusive=no;SourceType=DBF;SourceDB='+SYS(5)+SYS(2003)

ON ERROR DO errordemo IN buffdemo WITH MESSAGE

CREATE SQL VIEW myview CONNECTION testa ; AS SELECT * FROM test

DBSETPROP('MyView','View','SendUpdates',.T.) DBSETPROP('MyView','View','UpdateType',1) DBSETPROP('MyView','View','WhereType',3) DBSETPROP('MyView','View','BatchUpdateCount',1) DBSETPROP('MyView','View','UseMemoSize',255) DBSETPROP('MyView','View','FetchSize',100) DBSETPROP('MyView','View','MaxRecords',-1) DBSETPROP('MyView','View','Tables','test') DBSETPROP('MyView','View','Prepared',.F.) DBSETPROP('MyView','View','FetchMemo',.F.) DBSETPROP('MyView','View','CompareMemo',.F.) DBSETPROP('MyView','View','FetchAsNeeded',.F.) DBSETPROP('MyView','View','FetchSize',100) DBSETPROP('MyView','View','Comment',"") DBSETPROP('MyView.Charfld','Field','KeyField',.T.) DBSETPROP('MyView.Charfld','Field','Updatable',.T.) DBSETPROP('MyView.Charfld','Field','UpdateName','test.charfld') DBSETPROP('MyView.Charfld','Field','DataType',"C(10)") DBSETPROP('MyView.Numfld','Field','KeyField',.F.) DBSETPROP('MyView.Numfld','Field','Updatable',.T.) DBSETPROP('MyView.Numfld','Field','UpdateName','test.numfld') DBSETPROP('MyView.Numfld','Field','DataType',"N(10,4)")
 * Set View Properties
 * DBSETPROP('MyView','View','ShareConnection',.T.)
 * Set Key and Updateable fields.

SET MULTILOCKS ON

USE myview =CURSORSETPROP('buffering',5) INSERT INTO myview VALUES ("test",1) =REQUERY('myview') BROW ON ERROR CLOSE ALL
 * !* TABLEUPDATE(.T.)

PROCEDURE errordemo PARAMETER whatfailed messagebox(whatfailed,16+0,"Error") =TABLEREVERT(.T.)  Run the program file. Note the message displayed in the message box. Uncomment the TABLEUPDATE(.t.) command in BUFFDEMO.prg. Run the program file.</li> Note that the remote view is updated and no error message appears.</li></ol>

<div class="references_section">