Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 To: Yuri Rubinov
  Where is Yuri Rubinov?
 Pennsylvania - United States
 Yuri Rubinov
Subject: RE: FPT corruption
Thread ID: 78600 Message ID: 78663 # Views: 1 # Ratings: 0
Version: Not Applicable Category: Databases, Tables and SQL Server
Date: Thursday, October 06, 2005 5:41:40 PM         

> > Colleagues:
> >
> > What we found today might be an answer - if even only partial - to the problem in subject.
> >
> > Suppose, you have a table with DBF, CDX and FPT files. Suppose, all three have Read-Only attribute (say, copied onto an HDD from a CD or a DVD). Now, you reset DBF file's attribute to NORMAL (programmatically, with SetFileAttributes(lpFileName, dwFileAttributes) API function), and then try to open the table in exclusive mode - opens OK.
> >
> > You close it... and then try to open it again in exclusive mode - "Error 41: Memo file [name] is missing or is invalid" message pops up.
> > Or, the error occurs when you try to APPEND or INSERT to this table.
> >
> > OTOH, if all three parts of the table are made NORMAL prior to opening the DBF in exclusive mode - this corruption doesn't happen.
> >
> > Hence the questions:
> >
> > 1. What is the connection between DBF and FPT files for the table? Does DBF's header store the attribute of the corresponding FPT file, or is it something else?
> Can you walk with one foot if another is blocked somehow?

Yes, it's called "cirkul". (:>)

> Sure two files interact with each other when dbf is in use. And if they do not have the very same permissions, then the things may go wrong.
> You may review the file structures as they are in VFP help to get more on this.

What section? I haven't seen the description of the DBF's header since the printed Programmer's Guide for FoxPro 2.6.

I never heard about experiments like you did, and I cannot imagine the situation when it is needed.
It is very simple to imagine, actually: first portion of data (in DBF/CDX/FPT files) is sent to another location (i.e. customer, or another branch) on a CD or DVD and copied over onto an HDD; next time, another CD/DVD with daily (weekly, monthly) data for appending. Operator changes attribute for DBF but forgets (or doesn't know) to do so for CDX and FPT...
> >
> > 2. Could it be the cause of FPT corruption that DBF is NORMAL and FPT is READONLY?
> Yes, as you can see.

Spasibo, Yuri! I'm gonna put it to the test today.

"I'll be baaaak" (CA Gov. A. Schwartzenator as T-100.)




FPT corruption Posted by Ilya Rabyy @ 10/5/2005 11:39:20 PM
RE: FPT corruption Posted by Yuri Rubinov @ 10/6/2005 3:04:56 PM
RE: FPT corruption Posted by Ilya Rabyy @ 10/6/2005 5:41:40 PM
RE: FPT corruption Posted by Yuri Rubinov @ 10/6/2005 5:56:56 PM
RE: FPT corruption Posted by Ilya Rabyy @ 10/6/2005 6:59:35 PM