Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetNextModified says rec is changed, GetFldState says no
Message
From
23/06/2022 12:50:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
GetNextModified says rec is changed, GetFldState says no
Miscellaneous
Thread ID:
01684558
Message ID:
01684558
Views:
62
Running into an odd one. In the Unload of a form (actually, in the form class), we turn off buffering for the main table the form edits. A customer got an error 1545 (table has uncommitted changes) on that code. The error handler loops through all tables and reports their buffering status and whether any records have changes. For the relevant table, GetNextModified() reported a single changed record, but GetFldState() for that record returned all 1's.

This is the relevant code in the error handler. It's inside a loop and also in a CASE statement that ensures it fires only when buffering for the relevant table is 4 or 5. Yes, the table is selected before all this code. (Realize I should add IN to the GO command. I'll do that, but regardless, all lines here are operating on the same table.)
          lnNextChngd = GETNEXTMODIFIED(0) && , ALIAS(), .T.)
          IF m.lnNextChngd = 0
             ? "No changed records"
          ENDIF 
          DO WHILE m.lnNextChngd <> 0
             *-- TEG 5/31/2022 
             * Need to move record pointer first
             GO m.lnNextChngd
             ? RECNO(), ":",  GETFLDSTATE(-1)
             lnNextChngd = GETNEXTMODIFIED(m.lnNextChngd) && , ALIAS(), .T.)
          ENDDO 
Anybody have any ideas why GetNextModified and GetFldState would disagree this way?

Tamar
Next
Reply
Map
View

Click here to load this message in the networking platform