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

Invalid form

Status
Not open for further replies.

KarenJB

IS-IT--Management
Dec 17, 2007
44
US
When I try to modify my form I get this message:

Error loading file - record number 15. FRMCLIENT <or one of its members>. User properties : Memo file c:\vfp\projects\frmclient.sct is missing or invalid. frmclient.sct is not missing so I'm assuming it is invalid. Is there anything I can do to overcome this issue, I have made several changes to this form since by last good backup and would like to avoid redoing all that work. Thanks in advance for any help that might come my way.
 
Can you open the form as a table, that is:

USE frmClient.SCX

That'll give you a clue where the form DBF is broken or its just some bad data in the form description.

Tamar
 
It looks like record number 15 has a broken memo content. It's likely that also further memo contents are broken. You may get some of the things - especially code - out of the broken fpt file. Using the file like Tamar suggests would be a simple try, if that does not work you may use a hex editor or if all else fails you could still change the file extension of a copy of the sct file to txt and then open it with notepad, saving the valuable contents like the form methods code.

If it's really only record 15 you may only loose one control on the form. Good luck!

Bye, Olaf.

 
I am able to open it as Tamar has suggested. As I browse down to record 15 I start getting that error over and over. Should I delete that record or what should I do once I have that form open with the use command?
 
I've just noticed that the cursor will jump over any Memo field that has something in it. When I hover my mouse pointer near the Memo portion of the table I get the error. I guess I'll just start over. The weird thing about this is that I changed another form and rebuilt the application never touching this form. When I ran the executable it bombed out whenever I called this form. Scary.
 
Pointing to a memo field will make VFP show the content as a tooltip text, that does not work too, if the fpt file is corrupt, so it looks as more than record 15 is defect, perhaps this record has the first defect.

I doubt deleting a single record will help, but you could give it a try, trying anything to the file after doing a backup of the project can't hurt more than the damage, which was already done.

A reminder for regular backups...

You can try out repair tools like foxfix. Might be worth it instead of redoing the form. That depends on how valuable the time is, you'd need.

Bye, Olaf.
 
Thank you for the responses Tamar and Olaf, I certainly appreciate your efforts. I am almost finished redoing it and will make more frequent backups. Do you have any idea why this form got corrupted when I didn't even touch it during a rebuild?
 
I can understand you want to know when and how this error crept into the file to have a better chance to do health checks and prevent such corruptions. I can only do guesses here, it does not happen that often that I could tell from experience what exactly leads to it and what you should avoid at any costs.

I assume building will not touch files, if you don't explicitly check "Recompile All Files", if a file is recognized as unchanged it would simply be stored into the new build of the EXE as it is. You could check this if you put that corrupt scx into a testproject and compile with this option unchecked and then with this option checked.

If that's making a difference case it could have slipped through several builds without notice. The corruption would happen at save of a modification and at that moment it will not be obvious, it might even be the reason why it was not considered changed by following builds, if the SCT file lastmodifed date didn't change due to the save error.

Recompile All Files should help find offending forms and would be a good practice even if it means longer compile times. PACKing those files (SCX, VCX) also helps to keep them smaller and thereby prevent save errors, as the smaller a file, the less likely a file error occurs.

Bye, Olaf.
 
Open the project. From the Project menu, select Clean Up Project.

From the VFP 9 Help files:

Clean Up Project
Cleans up a project by removing records marked for deletion and packing memo fields.
 
dbMark,

while that doesn't hurt, it will only affect the pjx/pjt files, no more, no less.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top