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

I need to modify an existing form but i got ans error, is there a way to fix it ?

Status
Not open for further replies.

titoneon

MIS
Dec 11, 2009
335
US
Hi,
I am working on a form then when i was saving it after modified i was unable to save it cause i was getting a message as "record out of range" or something like that, anyway i did not have another choice that close VFP 9.0 SPK2, now when i issue "modi form formname" from the comman window i got the error below, and cannot open the form

" error loading file -record2 <or one of it is members> parent: class name is invalid
Is there a way to fix that, to be able to open the form ?
Thanks in advance
 
You can open the form as a table by issuing the command USE MyForm.SCX, where 'MyForm' is your actual form name. You must include the .SCX extension though.
From there, browse the table and look in the memo fields of record number 2. See if there is something funky going on with those. It's quite possible you may just need to set a path statement so the form can "see" the class library referred to.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Hi Dave,
But in record 2 there are so many fields that are memo field
 
use your.scx
goto 2

See what there is in this record. There are some places you could have a fault, eg in the Properties memo a name property could be an invalid name, eg starting with a digit instead of _ or a-z.

I hope that helps.

In some cases I've seen this message for the dataenvironment record of a form, where the form was intact, but even modifying it would need variables being present defined correctly for view parameters. That was the case when using macro substitution tricks in views. Record 2 in general is the DE, so this or something similar about your views or tables in the DE could be causing this, though there is nothing wrong with the SCX.

Another solution, maybe better, even if you fix your problem: Restore from Backup.

You don't know what got into that form to let it save corrupted in one or many places. Even if you manage to resurrect your form, it's jsut a matter of time it get's corrupt again, as the real problem is in some byte at some postion in the scx or sct file. Unlikely? I did repair scxes, which only worked for the next few modifications, even though stonefields repair didn't find anything. So I already have seen that in action, too.

You also never know how long ago an error is in a file, before it has an effect. So you could do something, that is the best best approach of all, perhaps: Take the code from the scx, put it into some notepad or txt, save.

Then redo your form from scratch and paste in the code. This gives you a fresh intact scx file. It's of course cumbersome, if yor form is complex, source code is one thing, controls are another, each control has it's own record, maybe even child records, with own code.

Bye, Olaf.
 
-record2 <or one of it is members>

The "or one of it's members part of that message means, it could not only be record2, but also record pointing to record 2, which are all tables, views and cursoradapters you have in the DE, all of which have Parent="Dataenvironment".

Bye, Olaf.

 
Olaf,
After i put something in one of the memo fields in record 2, the form opened but the labels dissapears, some of the command button too, one of the two grid also dissapears, so this is rare, the case is that the modifications i did were just today and when i was saving it i was having the problems, so the backup from yesterday won't bring me what i did today
Thanks
 
First, fine the form opens now again. But if there are things missing, they don't miss just because you put one thing into one memo field. If something is missing in there, it's missing.

Well, and how old is the form? You lose one day of work compared to how many years the form is old?

I also had situations I had to redo work. It usually takes less time to redo.

Bye, Olaf.

 
Olaf,
Yes you right, it is just 3 days old, i have to start all over again
Thanks
 
Well, sorry, there is nothing to restore at least 2 days of work without a backup. Experience show you'll do it better than before, anyway.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top