Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Malik Arora
  Where is Malik Arora?
 
 India
 Malik Arora
 To: Neeraj Charne
  Where is Neeraj Charne?
 indore
 India
 Neeraj Charne
 Tags
Subject: RE: DBF Corruption
Thread ID: 250414 Message ID: 251177 # Views: 32 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Friday, January 22, 2010 8:38:10 PM         
   


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.



COMPLETE THREAD
DBF Corruption Posted by Rajesh Malhotra @ 1/16/2010 6:14:23 AM
RE: DBF Corruption Posted by M. Akram Bhatti @ 1/16/2010 6:27:17 AM
RE: DBF Corruption Posted by ho me @ 1/16/2010 7:00:46 AM
RE: DBF Corruption Posted by tushar @ 1/16/2010 7:26:50 AM
RE: DBF Corruption Posted by Neeraj Charne @ 1/16/2010 7:29:20 PM
RE: DBF Corruption Posted by Joseph Agarpao @ 1/17/2010 4:29:03 AM
RE: DBF Corruption Posted by Martin Krivka @ 1/17/2010 10:41:20 AM
RE: DBF Corruption Posted by Joseph Agarpao @ 1/20/2010 4:30:17 AM
RE: DBF Corruption Posted by Om Rajan @ 1/17/2010 10:04:17 PM
RE: DBF Corruption Posted by tushar @ 1/18/2010 5:47:04 AM
RE: DBF Corruption Posted by Om Rajan @ 1/22/2010 11:13:39 AM
RE: DBF Corruption Posted by tushar @ 1/22/2010 12:37:55 PM
RE: DBF Corruption Posted by Malik Arora @ 1/21/2010 7:29:52 AM
RE: DBF Corruption Posted by Neeraj Charne @ 1/22/2010 8:05:14 AM
RE: DBF Corruption Posted by Malik Arora @ 1/22/2010 8:38:10 PM