if anybody can give solution to the following problem in vfp 7 version, it
would be very tankful.
I am facing a severe problem, that sometimes in some of my client's
systems,
records are missing or not updating properly . for example, if I want to
update 3 files (1. 'invoice' a header file, 2. 'invTrans' a detail file
3.'LedgerTransactions' a transacton file) in a begin-end Transactions, one
of the above files may roll back or not updated. It is sure that the records
are writting properly and çan be seen thro' brows command before 'End
Transactions' command. But after the 'End Transactions' command, it is found
that one of the file is not updated with records.
It is not showing any error messages even i put error handling functions.
this phenomina showing sometimes only. it starts saving after rebuild index
or recreate database.
Few days later it happens again.
In other systems database updating properly.
secondly how i can check database/index file integrity.
the following command are given for updation
***************************

bigin transactions

program code ------l

if !Tableupdate(1,.t.,'invoice')
rollback
=messabox('')
thisform.txtinvoiceno.setfocus()
return
endif
if !Tableupdate(2,.t.,'invTrans')
rollback
=messabox('')
thisform.txtinvoiceno.setfocus()
return
endif

if !Tableupdate(2,.t.,'LedgerTransactions')
rollback
=messabox('')
thisform.txtinvoiceno.setfocus()
return
endif

endtransactions

select invoice
if !eof()
skip
else
skip -1
endif
**************************

Re: tables are not updating properly by Paul

Paul
Tue Oct 26 08:32:16 CDT 2004

I'm not sure about this, but I can make a guess. You might still have
pending changes in those cursors.

I think that if an update fails, you will have to not only issue ROLLBACK,
but also TABLEREVERT on each of the cursors that still have pending updates.
Either that or fix whatever the problem was, and try the updates again.

Also, the transaction commands are BEGIN TRANSACTION and END TRANSACTION,
not "bigin transactions" and "end transactions". But you probably knew that.




"sameer" <sameer@discussions.microsoft.com> wrote in message
news:EEB27B51-8B8E-4EC6-B4A6-AC3D0FA69092@microsoft.com...
> if anybody can give solution to the following problem in vfp 7 version, it
> would be very tankful.
> I am facing a severe problem, that sometimes in some of my client's
> systems,
> records are missing or not updating properly . for example, if I want to
> update 3 files (1. 'invoice' a header file, 2. 'invTrans' a detail file
> 3.'LedgerTransactions' a transacton file) in a begin-end Transactions,
> one
> of the above files may roll back or not updated. It is sure that the
> records
> are writting properly and çan be seen thro' brows command before 'End
> Transactions' command. But after the 'End Transactions' command, it is
> found
> that one of the file is not updated with records.
> It is not showing any error messages even i put error handling functions.
> this phenomina showing sometimes only. it starts saving after rebuild
> index
> or recreate database.
> Few days later it happens again.
> In other systems database updating properly.
> secondly how i can check database/index file integrity.
> the following command are given for updation
> ***************************
>
> bigin transactions
>
> program code ------l
>
> if !Tableupdate(1,.t.,'invoice')
> rollback
> =messabox('')
> thisform.txtinvoiceno.setfocus()
> return
> endif
> if !Tableupdate(2,.t.,'invTrans')
> rollback
> =messabox('')
> thisform.txtinvoiceno.setfocus()
> return
> endif
>
> if !Tableupdate(2,.t.,'LedgerTransactions')
> rollback
> =messabox('')
> thisform.txtinvoiceno.setfocus()
> return
> endif
>
> endtransactions
>
> select invoice
> if !eof()
> skip
> else
> skip -1
> endif
> **************************
>