>Hello all,
>I am experience an Abnormal behaviour with the INSERT command
>
>1. I INSERT into a table say 'tableA' that is not curretly selected
>2. I update the grid which is based on a cursor say 'cursorA' which in turn derives it records from tableA using a SELECT statement
>3. All goes well i see the newly added record in the grid.
>4. If the machine goes off e.g power failure then upon restarting the application the grid displays without the newly addded record.
>5. I presume it's damaged or so so i attempt to recreate it as in step 1 & 2
>6. Then the old one (presumed damaged and the recreated on both appear giving a duplicate.
>
>A browse of the table after restarting windows shows the record with some values changing haphazardly.amazing!
>
>I am NOT using buffering (row or table). Table has no index. I realise this does not happen with APPEND & REPLACE.
>
>Is this by design? Any way out?
>Any help or advice will be appreciated.
If the power goes out, basically all bets are off.
If you area is subject to frequent power outages, I'd suggest:
- protect your server(s), PC(s) and networking equipment (e.g. hubs, switches) with uninterruptible power supplies (UPSs). These provide enough power to finish what you're doing and shut everything down gracefully.
- investigate "back-end" RDBMSs like SQL Server, Oracle, etc. These have greatly increased fault tolerance through the use of transaction logs.
- investigate Transactions in VFP (BEGIN TRANSACTION...). This is an attempt by VFP to implement the same type of fault tolerance as found in the back-end databases. Not as good, but maybe good enough for your purposes.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up