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!

help debugging 'Error loading data environment'

Status
Not open for further replies.

Judi201

Technical User
Jul 2, 2005
315
US
Hi!

I have a pageframe that contains a page with 6 buttons that call modal forms - designed as far as I can tell exactly alike except for tables used and report printed. Five work as I want but the 6th gives the error:

Error loading file - record number 6. frm arcorders <or one of its members> Loading form or data environment:Error loading the data environment. Table is in use.

Of course, I have gotten this before in testing modules but exiting and returning would solve the problem or I could find something actually open that should't be.

This forms works fine stand alone, just fails when called form the base form. It is MODAL with PRIVATE DATASESSION

So far I have tried:

1) Suspending and exploring

2) Opening the scx as a table and looking. Record 6 has the following in properties.

Code:
DataSession = 2
Top = 3
Left = 2
Height = 231
Width = 442
DoCreate = .T.
Caption = " "
WindowType = 1
BackColor = 102,153,153
Name = "frmarcorders"


I think I just don't know enough to know what to look for.

Thanks for any suggestions. All will be appreciated.

Judi
 
Sounds like you need to SET EXCLUSIVE OFF in your form base class' Load method.

Tamar
 
Tamar,

I made sure this was true, but I still get the error. Any other suggestions?

Judi
 
Judi, make a Backup of your form, open the form as table, go to record 6 and see what table name stays is in this record. Then try to open this table exclusive from Command window. If The table is corrupoted you will get the error.

Borislav Borissov
 
Borislav,

As I said above, I went to this record and I showed above what I found there. I don't see that it is a table. Records 3,4 and 5 reveal the tables opened. I can open them with no problem.

What am I missing?

Judi
 
Mike,

This is what is so confusing about this. As I said earlier I have 6 forms called from this page that work correctly. This one has only 1 table in the DE of the called form. I have been playing with changes in the DE setup but I don't see why the others do this and this one won't.

This is what I have for all of them.

The base form is MODAL with PRIVATE DATASESSION.

The called forms are the same.

The 6 tables are open in the first form. One or more of these tables are opened by the called forms.

Should I be able to do it this way, or have I just been lucky? What is the recommend way to call a form for quick data entry or to set up a report?

I appreciate any suggestions.

Judi
 
Mike,

Following Tamar's suggestion, I opened both forms and the class they are based on in the Class Browser and found only the reference to SET EXCLUSIVE that I added in the load of the form. The only other reference is set on and then off immediately. Is there another way that I can check?

I am puzzled that the record 6 that the error points to does not reference a table. Wouldn't you expect it to? Or I guess the form can't load because the table is in use. The record immediately before the error references the table.

I tried to use ISEXCLUSIVE() immediately before calling the form but I get nothing and the only option I can take off the error message is Ignore which allows me to close the form otherwise the system just hangs.

I just don't really know where to go from here. Thank you for any thoughts.

Judi
 

Judi,

A bit of a long shot, but .... is it possible that you are trying to open the table explicitly in the Load event, and you have the same table in the data environment?

I'm not sure, but it it's possible that situation might give a "File is in use" error.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike and Mike,

Well, this will be another of those things I will never know!

I checked each one of the tables and the code for EXCLUSIVE in both forms, and found nothing. Recompiled the app and when I tested it again it works so I don't know what it was.

It is working, so I move on. As you two have told me before understanding comes slowly. :)

Thanks to all for you helped me know things to check.

Judi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top