Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record missing after End Transaction
Message
From
09/04/2003 07:17:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00775393
Message ID:
00775407
Views:
12
>Hi All
>I have a problem with updating one table using VFP 6 SP3.
>
>Multilocks are ON and the buffer mode for the problem table is 3
>
>What happens is, the third table Assnlog doesn't get a record added to it. Well that's how it looks. If I check the record count of 'assnlog' just before the END TRANSACTION in the code below, the count has gone up by 1 and you can browse the table and see the record. Immediately after the END TRANSACTION the record count goes back down by 1 and the record has disappeared.
>
>Also if I then try to open Assnlog in a form I get the error 2005 and the message
>"Error loading file - record number 14. frmAssnMst or one of its members .Loading form or the data environment : Record is out of range ".
>
>(which is odd because that seems like the wrong message for code 2005.)
>
>After running a program to rebuild the cdx for Assnlog the table can be opened again but still with the new record missing.
>
>Any ideas would be greatfully appreciated.
>
>BEGIN TRANSACTION
>
>llSuccess = TABLEUPDATE(.T.,.F.,'assesmnt')
>
>IF llSuccess
> llSuccess = TABLEUPDATE(.T.,.F.,'land')
> IF llSuccess
> llSuccess = TABLEUPDATE(.T.,.F.,'assnlog')
> IF llSuccess AND THISFORM.adding AND THISFORM.casstype = "A"
> llSuccess = TABLEUPDATE(.T.,.F.,'lastupdt')
> IF llSuccess AND THISFORM.LevyAffected = .T.
> llSuccess = TABLEUPDATE(.T.,.F.,'levies')
> ENDIF
> ENDIF
> ENDIF
>ENDIF
>
>IF llSuccess
> END TRANSACTION
> THISFORM.SavedOk = .T.
> THISFORM.LastRecNo = RECNO()
>ELSE
> ROLLBACK
> =TABLEREVERT(.T.,'assesmnt')
> =TABLEREVERT(.T.,'land')
> =TABLEREVERT(.T.,'assnlog')
> =TABLEREVERT(.T.,'lastupdt')
> =TABLEREVERT(.T.,'levies')
> AERROR(laError)
> THISFORM.Cmdsave.ERROR(laError[1], 'Save', LINENO())
> THISFORM.SavedOk = .F.
>ENDIF
>
>
>TIA
>Chris

Chris,
I would reindex the table (deleting the tags and recreating would be much better).

PS: You might prevent the redundant llSuccess. ie:
BEGIN TRANSACTION
THISFORM.SavedOk = TABLEUPDATE(.T.,.F.,'assesmnt') AND ;
	TABLEUPDATE(.T.,.F.,'land') AND ;
	TABLEUPDATE(.T.,.F.,'assnlog') AND ;
	THISFORM.adding AND THISFORM.casstype = "A" AND ;
	TABLEUPDATE(.T.,.F.,'lastupdt') AND THISFORM.LevyAffected and ;
	TABLEUPDATE(.T.,.F.,'levies')

IF ( THISFORM.SavedOk )
	END TRANSACTION
	THISFORM.LastRecNo = RECNO('Alias?')
ELSE
	ROLLBACK
	TABLEREVERT(.T.,'assesmnt')
	TABLEREVERT(.T.,'land')
	TABLEREVERT(.T.,'assnlog')
	TABLEREVERT(.T.,'lastupdt')
	TABLEREVERT(.T.,'levies')
	AERROR(laError)
	THISFORM.Cmdsave.ERROR(laError[1], 'Save', LINENO())
ENDIF
With buffering set to 3 it's unlikely all your tableupdates are under your control (might implicitly update due to rec pointer movement).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform