Microsoft KB Archive/249836: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
(2 intermediate revisions by the same user not shown)
Line 52: Line 52:
<div class="errormessage">
<div class="errormessage">


Table buffer for alias &lt;view name&gt; contains uncommitted changes
Table buffer for alias <view name> contains uncommitted changes


</div>
</div>
Line 89: Line 89:


<ol>
<ol>
<li><p>Create a program file named &quot;BUFFDEMO&quot; using the following code:</p>
<li><p>Create a program file named "BUFFDEMO" using the following code:</p>
<pre class="codesample">CREATE TABLE test (Charfld c(10), Numfld N(10,4))
<pre class="codesample">CREATE TABLE test (Charfld c(10), Numfld N(10,4))
CLOSE ALL
CLOSE ALL
Line 116: Line 116:
DBSETPROP('MyView','View','FetchAsNeeded',.F.)
DBSETPROP('MyView','View','FetchAsNeeded',.F.)
DBSETPROP('MyView','View','FetchSize',100)
DBSETPROP('MyView','View','FetchSize',100)
DBSETPROP('MyView','View','Comment',&quot;&quot;)
DBSETPROP('MyView','View','Comment',"")
*DBSETPROP('MyView','View','ShareConnection',.T.)
*DBSETPROP('MyView','View','ShareConnection',.T.)
* Set Key and Updateable fields.
* Set Key and Updateable fields.
Line 122: Line 122:
DBSETPROP('MyView.Charfld','Field','Updatable',.T.)
DBSETPROP('MyView.Charfld','Field','Updatable',.T.)
DBSETPROP('MyView.Charfld','Field','UpdateName','test.charfld')
DBSETPROP('MyView.Charfld','Field','UpdateName','test.charfld')
DBSETPROP('MyView.Charfld','Field','DataType',&quot;C(10)&quot;)
DBSETPROP('MyView.Charfld','Field','DataType',"C(10)")
DBSETPROP('MyView.Numfld','Field','KeyField',.F.)
DBSETPROP('MyView.Numfld','Field','KeyField',.F.)
DBSETPROP('MyView.Numfld','Field','Updatable',.T.)
DBSETPROP('MyView.Numfld','Field','Updatable',.T.)
DBSETPROP('MyView.Numfld','Field','UpdateName','test.numfld')
DBSETPROP('MyView.Numfld','Field','UpdateName','test.numfld')
DBSETPROP('MyView.Numfld','Field','DataType',&quot;N(10,4)&quot;)
DBSETPROP('MyView.Numfld','Field','DataType',"N(10,4)")


SET MULTILOCKS ON
SET MULTILOCKS ON
Line 132: Line 132:
USE myview
USE myview
=CURSORSETPROP('buffering',5)
=CURSORSETPROP('buffering',5)
INSERT INTO myview VALUES (&quot;test&quot;,1)
INSERT INTO myview VALUES ("test",1)
*!* TABLEUPDATE(.T.)
*!* TABLEUPDATE(.T.)
=REQUERY('myview')
=REQUERY('myview')
Line 141: Line 141:
PROCEDURE errordemo
PROCEDURE errordemo
PARAMETER whatfailed
PARAMETER whatfailed
messagebox(whatfailed,16+0,&quot;Error&quot;)
messagebox(whatfailed,16+0,"Error")
=TABLEREVERT(.T.)
=TABLEREVERT(.T.)
                     </pre></li>
                     </pre></li>

Latest revision as of 13:51, 21 July 2020

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 <view name> 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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. 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
    
    *Set View Properties
    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','View','ShareConnection',.T.)
    * Set Key and Updateable fields.
    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 MULTILOCKS ON
    
    USE myview
    =CURSORSETPROP('buffering',5)
    INSERT INTO myview VALUES ("test",1)
    *!* TABLEUPDATE(.T.)
    =REQUERY('myview')
    BROW
    ON ERROR
    CLOSE ALL
    
    PROCEDURE errordemo
    PARAMETER whatfailed
    messagebox(whatfailed,16+0,"Error")
    =TABLEREVERT(.T.)
                        
  2. Run the program file.
  3. Note the message displayed in the message box.
  4. Uncomment the TABLEUPDATE(.t.) command in BUFFDEMO.prg.
  5. Run the program file.
  6. Note that the remote view is updated and no error message appears.


REFERENCES

For additional Information, query the Visual FoxPro product documentation for the following topics:

  • Buffered Updates (defined)
  • REQUERY()
  • TABLEUPDATE()
  • TABLEREVERT()

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by John Desch, Microsoft Corporation.



Additional query words: VIEW

Keywords: kbdatabase kbprb KB249836