Pall Bjornsson
2007-10-04 15:54:32 UTC
Hi !
Using VFP9 SP1, I keep getting the 2065 error on a temp table on local
driver, that actually is a remote view. Error stating the temp file "... has
a file length / record count incnsistency. The table will need to be
repaired before transactions can be committed properly."
The error only happens when the remote view as all new records, not when
updating existing ones. Not linked to any particular PC, as this happens on
every machine tested.
There are some links that can be found on Google for this error, the ones
that that are most fresh are
http://fox.wikis.com/wc.dll?Wiki~More2065ErrorsWithVFP9~VFP and
http://fox.wikis.com/wc.dll?Wiki~SetTablevalidate~VFP.
Both of them suggest trying to use either SYS(1104) or "Set tablevalidate to
0". Neiter of those fixed my problem.
I also found one mention of a BUG report at MS, but that one was closed
without a fix as the stack dump pointed to an external application. Not so
in my case, as the error is all Visual Foxpro.
I did however find a strange workaround which seems to work, and the reason
for my writing is both to get comments on that workaround, and to hear about
more ways to work around the error, if there are any?
My workaround:
Lets say you have a remove view named vView with a field name fField, then
before the begin transaction stuff, I do the following:
local lnRecno
select vView
lnRecno = recno()
if InList(GETFLDSTATE("fField",3,4) and BETWEEN(lnRecno,1,RecCount())
go (lnRecno)
endif
That's it! Issuing those command seems to force VFP to flush the correct
header info. The GETFLDSTATE() is just a safety measure to make sure that
the commands are only executed in that special case when the record is going
to be appended, and note that in my case I always have just one singe record
to append in this case. Some changes would probably be needed for multi
record appends.
Any comments on this and any more workarounds ?
Palli
Using VFP9 SP1, I keep getting the 2065 error on a temp table on local
driver, that actually is a remote view. Error stating the temp file "... has
a file length / record count incnsistency. The table will need to be
repaired before transactions can be committed properly."
The error only happens when the remote view as all new records, not when
updating existing ones. Not linked to any particular PC, as this happens on
every machine tested.
There are some links that can be found on Google for this error, the ones
that that are most fresh are
http://fox.wikis.com/wc.dll?Wiki~More2065ErrorsWithVFP9~VFP and
http://fox.wikis.com/wc.dll?Wiki~SetTablevalidate~VFP.
Both of them suggest trying to use either SYS(1104) or "Set tablevalidate to
0". Neiter of those fixed my problem.
I also found one mention of a BUG report at MS, but that one was closed
without a fix as the stack dump pointed to an external application. Not so
in my case, as the error is all Visual Foxpro.
I did however find a strange workaround which seems to work, and the reason
for my writing is both to get comments on that workaround, and to hear about
more ways to work around the error, if there are any?
My workaround:
Lets say you have a remove view named vView with a field name fField, then
before the begin transaction stuff, I do the following:
local lnRecno
select vView
lnRecno = recno()
if InList(GETFLDSTATE("fField",3,4) and BETWEEN(lnRecno,1,RecCount())
go (lnRecno)
endif
That's it! Issuing those command seems to force VFP to flush the correct
header info. The GETFLDSTATE() is just a safety measure to make sure that
the commands are only executed in that special case when the record is going
to be appended, and note that in my case I always have just one singe record
to append in this case. Some changes would probably be needed for multi
record appends.
Any comments on this and any more workarounds ?
Palli