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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not a table/dbf 1

Status
Not open for further replies.

dmusicant

Programmer
Mar 29, 2005
253
US
One of my apps occasionally uses an FPW 2.6a screen that I haven't changed in ages. It's a simple enough screen, I guess I could recreate it, but it would take a while. Well, I just issued the command in the FPW Command Window to modify the screen and it says Not a table/dbf. Is there a way I can fix that or do I need to recreate the screen. The SCX is dated 2006, I could rummage around looking for a previous version, there's probably some around, maybe they'd be alright, maybe not. However, I'm wondering if I can maybe fix the screen. It's extremely simple, just a screen with some text on it, instructions that show up when the user hits F1. Thanks for ideas.
 
Well, I found a version of the screen and the four files had dates from 1999 through 2002, and I can open the screen without error. I modified the text and regenerated the screen. Man, it can really pay to keep ancient backups! This was just on a CD I have lying around I picked up off a shelf, the CD is marked "Backup <my stuff> 3/20/02
 
I take it use screen_name.SCX didn't work. Also, I assume you didn't use fox 2.6 open command or create a project.
 
Well, there is a project for this application but I don't ordinarily use it. I created the project in order to create an EXE, but normally I just run the app from source code, so don't see the point of using the project. There may be ancillary benefits to using the project but I'm unaware of them.

I didn't issue a command to "use screen_name.scx." What I do is issue in the command window MODIFY SCREEN screen_name. That's where I got the Not a table/dbf error. I presume the screen (or one of the four files, don't know which it would be, the SCX, SCT, SPR, SPX) was somehow corrupted. I imagine it wouldn't have been the SPR, though. That's compiled code. One of the other files is a table, I guess the SCX or SPX or both.
 
Yes, this is almost certainly a case of the SCX file being corrupted (but, as you say, not the SPR, as this is essentially a text file).

The point is that the SCX is just like a DBF file, so you can open it with USE and examine it with BROWSE. That's what SBTBILL was suggesting. If the USE doesn't work, you know the file is corrupted. If it does work, you can see if any of the indivuaL records appear to be corrupted, and, if so, delete them.

You can also try a third-party file recovery utility - but with no guarantee of success.

It's far easier to restore from a backup - as you have discovered.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
The primary Screen file (the SCX file) is, in reality, a data table.

If that file got corrupted, then your attempting to execute MODIFY SCREEN <whatever> would not work (as you saw).
NOTE - the command MODIFY SCREEN <whatever> would not attempt to open the SPR file, only the SCX/SCT files.

Trying to manually open that file (the SCX file) with a USE screen_name.scx would confirm the integrity of the file/table.

If it is corrupted, I hope that since 2006 a Backup was made - to which you can revert.

Good Luck,
JRB-Bldr
 
I have backups here and there, but I suspect that the ones made after 2006 had the corrupted table. The date shown on the screen files that won't open is 2006. Most of my backups are of my most recent app files. The screen in all recent backups I found yesterday wouldn't open. I didn't try every backup I have, I don't know where they all are. I chanced to find the CD with the 2002 backup and the screen would open. I don't know if there are differences, I will check. Maybe I made a change between 2002 and 2006, I must look and find out. The screen has no significance in how the app works, however. It simply displays help information for the user. That user is myself, period! Well, I tried to do something yesterday and wasn't sure how to do it and consulted my own help screen, not something I normally do. I wrote the help screen for others, hoping it would someday be used by others (I love this app!). I followed my own instructions and got into trouble! I figured out what was wrong and that my instructions were inadequate and decided to update the help screen. There are actually 2 help screens, you bring up the first with F1 and then if desired you hit F2 to bring up the second. The second seems fine. Now that I've got help screen 1 working, I updated the text on it with correct instructions for the task I was doing.
 
If you had run that SCX through the Converter that used to come with VFP, you'd probably get that error, too.

Tamar
 
Hi Tamar,

I don't believe I've used any of the VFP converters. Maybe I should try, I don't know. I've just called the SPRs inside my main PRG. In replacing the screen I was not able to modify I just backed up the 4 files (SCX, SCT, SPR, SPX) and replace them in my \Programs directory with the ones from my 2002 backup CD. Then I made the changes to the screen that I wanted to make and regenerated. This seems to have worked OK.
 
This seems to have worked OK.

That's great to hear.

I'd suggest that it might be time to make a new Backup of all of your application's files - just in case.

Good Luck,
JRB-Bldr
 
Don't run your code through the Converter. You end up with an ugly hybrid of FP2.x and VFP code. Much better to use an old form as guidance for creating a new one.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top