Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT: Please help. Table won't open from exe 2

Status
Not open for further replies.
Jun 1, 2004
18
GB
Hi
I am having a problem and I am stumped and desperately need help. It started happening today at 3pm for no apparent reason. I'm using FoxPro 7.

When I try to USE a particular table from an EXE file I build I get the following error:

Error loading file - record number 5. form1 <or one of its members>.Loading form or the data environment : File access is denied

The application and access to the table works fine from my IDE.

I have tried everything I can think of REINDEXing, VALIDATE database with recover option, restoring the table from backup tapes, zapping the table, building the table again from scratch. Nothing works. It is only with this one table I have the problem; all others work fine. It is only when I run the EXE, the table and apps work fine from the IDE.

Does anyone have any idea what might be happening here?

Thanks!
 
The error suggests, that something with a form ("form1 (or some of it's members") is wrong, not your database.

SCX, VCX files etc are nothing else than tables themselves, so a form is also a table.

try:
use ("c:\myproject\forms\myform.scx") in 0
browse

then look at record number 5.

Bye, Olaf.
 
Olaf is correct. The error message is indicating a problem in your form named "form1", not a database table. I would re-evaluate the code changes you made in that form between the last compile that worked and the first one in which the error began to occur.

Good luck,
Steve
 
Thanks for your helpful replies. Unfortunately I've not yet found a solution. Here is some more data:

1. The error occurs when the data environment is loaded for the first form opened by my application (in the EXE only remember; application works fine when run from the foxpro IDE).

2. There have been no code changes to that form since the previous release, which worked fine in both IDE and EXE.

3. The same error occurs if I build an EXE from a blank, new form with just the one problem table in its environment; also occurs if I remove the table from the data env and put the following line in the init() method:

USE theproblemtable AGAIN IN 0

Using any other table and the EXE works fine.

4. Rolling back to a previously built EXE: the application works fine; no problems opening the table. So the table can be opened and used fine.

Basically, the IDE doesn't seem to be able to build an EXE that will open this one particular table (which is a bit of a bummer to say the least). Any other ideas?

Thanks for taking the time to read this far and help.
Graham
 

Have checked to see if the table was marked as being included in the project, which would mean that it get compiled along with the rest of the files?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
mGagnon has a good suggestion if you've included that table in the project. If so, try excluding it from being compiled in the EXE if you want to write to it. In Project Manager, right-click on that table and select Exclude.

thread184-681690
thread184-936424

dbMark
 
Ok, checked to see if file is included. It's excluded.

Using the filemon utility that dbMark suggested (excellent utils by the way... thanks for that), I can see that the table file is opened and a few reads made and then the file is closed and the error handling starts.

Compared the trace with traces for other tables which open fine, it seems like the last thing that happens before the error handling starts is a load of reads to the DBC file.

It opens the table, the memo file but doesn't get as far as the index file.

I think that there is some corruption in the DBC file related to the indexes. Any ideas how I could fix this?
 
Open the database exclusively, and issue a:

Validate Database Recover

...from the command window.

boyd.gif

 
Ok.... I have found the problem: looks like it was corruption in the index file. REINDEX did not solve it, but deleting the indexes and adding them again did.

Thank you all for your help.

 
Glad you got it fixed!

REINDEX fixes most but not all index corruption issues. Earlier you'd said you'd rebuilt the table from scratch, so I assumed you'd done the same for the indexes/tags.
 
You reminded me that I did try deleting and re-adding before posting here.

I think there are two corruptions here, one in the dbc and one in the cdx. Reason I say this is, I fixed the problem in the test/design database (which is a mirror of our operations database) and the last thing I did there was redo the indexes.

Now I've done that in the operations database but I still have the problem linked to the same table. So it looks like I will have to go through the rest of the steps that I also tried in the production database.

Will tackle that tomorrow and keep you posted.
 
Ok, finally fixed problem. Not 100% sure what went on but I'm pretty sure the corruption was in the Project itself (not the dbc, or dbf.)

To fix it required a few steps, the last of which was rebuilding the indexes of the problem table.

Thanks very much for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top