Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, March 26, 2013 5:42 PM
I'm getting "Error loading file - record number 6 frmAreas < or one of its members > Loading form or the data environment. Record is out of range" on multiple forms in an existing app that had been working fine. If you click Ignore, the form will load and everything seems fine but clearly something has gone askew.
I made changes to two tables using MODIFY DATABASE. The errors happen to tables that weren't modified too. Anyone have ideas on what's happening and how to fix it?
The error is always on record number 6. The forms open fine in Project Manager.
Bob Morris
All replies (5)
Wednesday, March 27, 2013 7:18 AM âś…Answered | 1 vote
Copying over controls does not copy over dataenvironment and form methods, properties or expressions in them, that execute during initialization.
Indeed changed tables can cause views not to work anymore and that can also lead to that error. I also had this error because of undefined view parameters when starting a form. Using all views in the dataenvironment with nodataonload=.t., then set view parameters in form init and requery, but that doesn't save you from broken views due to table changes.
In more cases such errors point to a scx or vcx corruption, but I'd be cautious about such rescue attempts. You best have a regular backup so you can revert to earlier form versions, not just one per month, maybe even all different versions you had. SCC (source code control) can be used with VFP for versioning and keeping all versions, you have the project hook to also backup what you edit and nothing is as simple as restoring a whole project from a daily backup, you only loose a day work and you can mostly reproduce that in less time, either because you worked on different things and only one broke or you don't need to repeat all your design efforts, as you remember what you did.
I remember once a bug in an OCX used in a certain way lead to a reproducable C5 error, but aside of that you better not try to fix a form or class, restore it. Even if a fix seems to work you don't know what you inherit in your fixed form, byting you again in a few days. You might try repair with foxfix or other tools of that range to fix dbf corruption of scx/vcx etc. Or you need to know in detail.
Bye, Olaf.
Olaf Doschke (Setmics)
Tuesday, March 26, 2013 7:14 PM | 1 vote
To resolve the error:
Access the record referenced in the error, open the form as a table as follows:
USE YOURFORM.SCX
To move to that record, use the GO command
GOTO 6
You can often find the cause of the error in the Properties, Methods, Class, Classloc, Objname, or Parent fields.
Systems Analyst
Tuesday, March 26, 2013 7:51 PM | 1 vote
I found this after I left my original message and tried it. Everything looked ok, nothing garbled. So, I couldn't determine what if anything to change.
Finally, I did MODI FORM and cut and pasted everything into a new form and it appears to be working.
I think when I was testing and the app crashed that it mangled data in the forms probably because I inadvertently left the project open while testing.
Bob Morris
Thursday, March 28, 2013 3:40 AM
The forms weren't complicated, so cut and pasting objects on the form and the code in the custom methods seems to have worked. Then I had to bring the DBC back from the dead. I did have recent backups, not quite sure why they didn't work.
A while back I was testing new code and accidentally had the Project manager open. The crash deleted the project and all the files in it. Luckily I had a very recent backup.
The same thing may have happened this time too. The open Project caused some forms to get corrupted.
Bob Morris
Friday, April 12, 2013 12:01 PM
The file seems to be corrupted, that' why you are having this error. You need to repair the file to avoid such error. Get any third-party recovery software for Visual FoxPro database files. You'll get a good range of such recovery software. You may check free demo version of the software if available before buying any of them. Demo version will show you the preview of recovered data and content. If you'll be satisfied with the result, then you can get the full version of the software. I've read about a software named as SysInfoTools DBF Recovery software. Its demo version is absolutely free. You can check its demo version before buying any third-party recovery software. Hope it will help you this matter.
Good luck.