Discussion:
Error 2065 on End Transaction for remove view to MSSQL server
(too old to reply)
Pall Bjornsson
2007-10-04 15:54:32 UTC
Permalink
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
Anders Altberg
2007-10-06 13:30:48 UTC
Permalink
The VFP commands BEGIN TRANSACTION - END TRANSACTION | ROLLBACK do not
concern or apply to remote databases. They are exclusively for transaction
management of DBF tables that are part of a VFP database or free DBF tables
that have been set up with MakeTransactable( alias) in VFP9.
Transction management of remote databases is eithere automatice or handled
with SQLCOMMIT(), SQLROLLBACK for ODBC connection or
-Anders
Post by Pall Bjornsson
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?
Lets say you have a remove view named vView with a field name fField, then
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
Pall Bjornsson
2007-10-09 16:49:56 UTC
Permalink
That is what makes this error even more wierd !

Palli
Post by Anders Altberg
The VFP commands BEGIN TRANSACTION - END TRANSACTION | ROLLBACK do not
concern or apply to remote databases. They are exclusively for transaction
management of DBF tables that are part of a VFP database or free DBF tables
that have been set up with MakeTransactable( alias) in VFP9.
Transction management of remote databases is eithere automatice or handled
with SQLCOMMIT(), SQLROLLBACK for ODBC connection or
-Anders
Post by Pall Bjornsson
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?
Lets say you have a remove view named vView with a field name fField, then
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
Loading...