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!

Error Loading form or the data environment : File access is denied THISFORM

Status
Not open for further replies.

chriscrowhurst

IS-IT--Management
Sep 23, 2014
14
GB
Hi,

In one of my VFP7 apps the company runs, I am occasionally getting the following error when a form loads :

Error loading file - record number 35. frmSiteVisitUpload. Loading form or the data environment : File access is denied THISFORM

The form is automatically launched from a timer and I cannot reproduce the error so it is tricky to debug! I have seen this type of error before, but only if a form is trying to open a table that is opened exclusively elsewhere, so that has been easy to fix.

I have opened the SCX and browsed record 35 and it contained details about the form itself, and not a object withing the form. I could not see anything in particular that was suggesting a file access is denied error.

I have checked the form to make sure in the data environment all tables are open shared. I have removed the few views it was using and replaced with queries to see if that made a difference.

Can anyone shed some light as to what might be causing this, as I am running out of things to check for ?

Cheers

Chris
 
What is in record 35 if it's not a table or view of the DE?

We can't judge that from here and record 35 is not always the same thing about a form or it's DE, that varies depending how many tables/views/CAs are in the DE or how many OLE/ActiveX Controls or whatever it is, that can't be accessed. It can't be the SCX itself, as then the error couldn't be so specific about the record number.

Bye, Olaf.
 
Hi Olaf

Thank you for your response. Below is some further information regarding record no 35 :

Class = emsstdform
Classloc = ..\..\ems\classes\ems.vcx
Baseclass = form
Objname = frmSiteVisitUpload
Properties:
DataSession = 2
Height = 42
Width = 397
ShowWindow = 0
DoCreate = .T.
BufferMode = 0
AutoCenter = .T.
Caption = "PROCESSING"
HalfHeightCaption = .F.
Visible = .F.
TitleBar = 0
WindowType = 0
AlwaysOnTop = .F.
messagelog =
reportnumber = Unknown
Name = "frmSiteVisitUpload"
cusEnvironment.Name = "cusEnvironment"

The class emsstdform is a blank form, which has some properties set and a custom object which sets up the environment for the form with a bunch of SET commands. It also contains a method that updates the database path for all objects in the DE. This method is called in the BeforeOpenTables event of the frmSiteVisitUpload form.
 
Well, if this error comes from starting a form class, and this is just the first record of a the form class inside the vcx library, the problem might be reading the VCX itself.
Are Parent and Methods fields empty? You don't list the full record.
Perhaps BROWSE NORMAL to see everything.

Bye, Olaf.

 
Hi Olaf,

The Parent field was empty and the Methods field contained all the method code I expected for the form.

Regards

Chris
 
The above should indicate that this is the record that defines the form object. This record has to be immediately after the last cursor/views/CA record (or if no cursors/views/CA then after the Dataenvironment record). If there are other records before this record, then an error will occur as it cannot find the parent.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top