×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

message error "FIle is not open"
2

message error "FIle is not open"

message error "FIle is not open"

(OP)
Hi,

I have a problem when I try to build an executable project in visual foxpro 9 and I am having this message error "FIle is not open"


can you help me please?

RE: message error "FIle is not open"

If you haven't already done so, quit VFP and re-start it. See if that makes the probem go away.

Failing that, one of your reports, forms or visual class libraries might be corrupted. Try opening each of those in turn. If any of them fails to open, remove that file from the project. If the error then goes away, then you will have to re-create the file in question or restore it from a backup.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: message error "FIle is not open"

Does it come up, if you restart VFP and do the build first?
Some PJX might depend on first CDing into a certain default folder for includes to work.
You also might fail on read only files.

The first thing I'd do to get to the detail what exactly fails to compile is:
1. Open up the debugger before BUILDing
2. Make sure the debugout window is open
3. Now BUILD, this will make VFP display detail messages what is compiled during the build to the debugout window as it happens.
4. When the error rises up the last file reported in the debugout window is very likely to cause the problem, it may be corrupt, it may have a reference to a non existing file, missing image, whatever.

Bye, Olaf.

RE: message error "FIle is not open"

Quote:

I try to build an executable project in visual foxpro 9

If you are trying to build an executable, the first thing you need to do is to learn how to use the VFP Debug tools so that you can investigate these sort of problems yourself and, hopefully, resolve them.

Olaf has given you a start on that above.

I'd recommend that you spend some time watching the free VFP video tutorial at:
http://www.garfieldhudson.com/freevideos.aspx

There are a number of videos there for viewing on-line or downloading for later viewing.
One in particular you might want to look at is:
Building a Simple Application - Pt. 2

Part 2 of the series. In this video we complete the User (staff) management forms. One highlight of this video is the use of the Visual FoxPro Debugger.

Good Luck,
JRB-Bldr

RE: message error "FIle is not open"

I have had the exact same problem about 2 years ago for a season. Windows 7, iirc.

The "File is Not Open" messagebox kept popping up at build time ... but sporadically (never consistently). It became a minor annoyance only, as it never prevented the build. I'd just 'patiently' go through the (build) motion(s) a 2nd time, iirc, and the build went OK in spite of the messagebox error. (I did not know how to explain the issue to Olaf, Mike, or others, nor could I discover others (google) who were daunted by that message).

The problem somehow *corrected itself* after a season, ... furthermore, I have not experienced that messagebox of late.

So consider, for that issue to be (1) sporadic and/or (2) to spontaneously 'self-correct' seems (to me) a seasonal Windows-VFP bug. I would not be surprised if the debugger shows nothing amiss.

Please consider to (1) test your build on another Windows version, if feasible, (2) restore your computer to an earlier restore point, and/or (3) update Windows.

Utmost blessings!
Philip

RE: message error "FIle is not open"

(OP)
thanks all for your help,
yes i try my project in other version of windows in 2 other pc and idon't have this problem and my project execute correctly

RE: message error "FIle is not open"

There is a very easy explanation if you try to build after running code, many forms and classes can still be in memory and accessing them for compilation might then show up such an error. That's not a bug, simply a problem of caching stuff you therefore aren't allowed to edit (which already shows up, when you try to edit a PRG or VCX class or SCX after you ran it) or to compile it.

Therefore the questions again: Does it happen at all, when you restart VFP? Because that let's you start with a clean state. And if even then this problem exists, what file shows up in the debugout window during build at the time the error messagebox stops the build?

Bye, Olaf.

RE: message error "FIle is not open"

Just because you don't see the problem with other versions of Windows, that doesn't mean that it is your Windows version which is to blame. On the contrary, this problem can occur in all versions of Windows (and all versions of VFP). Upgrading to a new version just to solve this problem would be a pretty drastic step.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: message error "FIle is not open"

Quote:

There is a very easy explanation if you try to build after running code, many forms and classes can still be in memory and accessing them for compilation might then show up such an error.

Indeed. Another thing that can cause build problems during a debugging session is a SUSPENDed program. Simply typing Cancel in the command window can often clear that up.

RE: message error "FIle is not open"

Quote (Dan)

Quote:

There is a very easy explanation if you try to build after running code, many forms and classes can still be in memory and accessing them for compilation might then show up such an error.

Indeed. Another thing that can cause build problems during a debugging session is a SUSPENDed program. Simply typing Cancel in the command window can often clear that up.

Thanks Dan, Mike, and Olaf. Additionally, almost 100% of the time I must hold down the <esc> (like the cancel command) key after launching VFP-9 SP2 on all machines and (all) Windows 8, and 10 Versions. (Thus, I strongly suspect it is not just me)

... VFP initialization consistently gets bogged down during its web-searches, methinks, sometimes for over a minute.

RE: message error "FIle is not open"

Quote:

VFP initialization consistently gets bogged down during its web-searches, methinks, sometimes for over a minute.

What web search? If you are saying that VFP is accessing the Internet during intialisation ... well, I can't imagine why. You must have some setting or start-up procedure which is causing that to happen. If so, you should be able to disable it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: message error "FIle is not open"

Well, Mike,

there is the task pane, and that looks for example for gotdotnet.com, which doesn't exist anymore.
So mydocpro, simply turn off task pane and VFP IDE starts in split seconds.

Besides that, it's just the simplest way to put VFP into it's clean initial state, you may also do with CLEAR ALL, RELEASE ALL EXTENDED and such clean up commands. VFP is hard sometimes on file handles, though, even when you explicitly closed them, but more so on file handles you only indirectly cause by USE or SET TEXTMERGE or other things. So an IDE restart is the best thing to do before compiling.

Besides that, I seldom need to compile an EXE, I develop code running in the IDE.

Bye, Olaf.

Edit:

Also see http://mattslay.com/task-pane-slow-to-load-in-visu...
and also see thread184-1753811: Task Pane Manager - updated

RE: message error "FIle is not open"

Olaf,

I had a feeling at the back of my mind that there was some VFP component that connected to the Internet at start-up. I had forgotten about the Task Pane.

I see the Task Pane has a setting labelled, "Check for New Internet Content". I have that set to Never, so it has never been a problem for me. I think my choice of that setting goes back to the days when we connected to the Internet via a dial-up modem, which meant a noticeable delay at start-up, not to mention a monetary cost.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: message error "FIle is not open"

Olaf (and Mike), thank you exceedingly for clearing the clouds on VFP-9's Task-Pane, and for all your inspiring pearls, including the IDE! (I never use(d) Task Pane (an eye-sore, TBH) and have kept it hidden beneath the VFP status bar (the past 10 years or so)).

Utmost blessings!
Philip

RE: message error "FIle is not open"

You may try to
  • disable antivirus
  • run VFP as an administrator

RE: message error "FIle is not open"

Quote (Mike Lewis)

I see the Task Pane has a setting labelled, "Check for New Internet Content". I have that set to Never, so it has never been a problem for me.

Same here. In fact, my usual preferred default is to disable the task pane entirely.

But it amazes me how many experienced VFP developers do not know they can control that behavior. When I started a previous job, my predecessor had left behind several instructional videos intended to help the person who came behind him. I picked up on the quality level of the videos when the first one started with him whining about how slow VFP starts (because of the task pane).

RE: message error "FIle is not open"

(OP)
Hi, this problem was resolved . it's caused by Kaspersky Antivirus. I disabled Anti Hacker, Proactive Defense , Anti Spam And Access Control and i was able to get rid of the error.

RE: message error "FIle is not open"

The recommendation with antivirus is to exclude VFP extensions like PRG, SCX, VCX, FRX,... Of course you make antivirus software suspicious by changing files. The problem is worse than with doc/docx or txt, because this can really contribute to corruptions, but mainly of course, VFP hen is uncapable to keep an exclusive lock on file for compiling. If you never heard of that, now you did.

Bye, Olaf.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close