Hi Neeraj,
you are absolute right, about low priority file, being corrupted. but I doubt about the programmer, if his very low priority files are being corrupted. See all that matters is your time. you cannot run around for small file corruption, neither your client knows, which table is corrupted. He has to restore backup, if he is not serious about UPS & Earthing of Electricity, which are main causes of corruption.
Client exploit you, if you keep going and repairing their files.
The restore backup option is when user are upto 5. if they are more than 5, I think it is pretty high time to convert the backend from VFP to SQL Server. YOu will not face problems of table corruption in SQL Server.
Secondly, a funny thing to me though, Multi user Companies, always use good backup devices, in my case, they either have big centralised UPS or individual UPS. the problem only comes with small scale clients, who are more fussy about the money than their data.
Thirdly, when I said, make a cursor from the table, that does not means, you have to populate it with all the records of the master table.
What is the thing, we do with the data.
1. Data Entry/ Modification
2. View them in reports
in case of reporting, you use select and joins and then use them in reports ( dont dont ever use directly tables in reports)
in case of Data entry , you know, if it is a new record, you dont need all previous records from master. in case of modification, you need which record needs to be populated in temp. cursor.
You dont need to index your cursors.
One more thing, I can be wrong also in some cases, where the software demands the other scenario. All what matters is , do a lot of analysis before you develop your application.
Thanks
Malik.
> > 2. At start, check files and in case of any error, inform user to restore the backup.
>
> What if Program has 100 files and only one files header is corrupted which is a small problem to repair but when you restore backup other user loose their recent entries. (You can't restore only one file where all the files are linked)
>
> > 3. The best way :
> > Design your forms in such a way, that you do all the transaction in a temporary cursor having same structure like the main tables and at the end while save button is pressed, you open the main tables, update them and immediately close them. Working on main tables is dangerous, and its like your application is sitting on a time bomb.
>
> When Tables having Thousands(may be more) of Transaction then again & again opening & closing Time is important and what about cursor's Index's will you create them.
>
> my personal experience : Corruption due to electric shock/Failure
>
> When you are using Tables in Shared Mode the Tables Courrption chances increase but in exclusive mode very less.