Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jamie Osborn
  Where is Jamie Osborn?
 Melbourne
 Australia
 Jamie Osborn
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: CLOSE DATA
Thread ID: 21859 Message ID: 21864 # Views: 5 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Thursday, April 03, 2003 8:31:20 AM         
   


>
> Thanks Michael.
>
> Unfortunately it didn't work but I appreciate the advice.
>
> I'm actaully using tables with non .DBF extensions and am going to try and change all the places in the code so that they become .DBF extensions instead.
>
> Maybe something's going wrong there.
>
> Am fast running out of ideas.
>
> Cheers.
>
> Russell.
>
> > >
> > > Hi all.
> > >
> > > I have a very strange problem which I've spent two days trying to fix without success.
> > >
> > > I am getting an error message "File is in use" when the file is patently not in use. A simple DISP STAT shows this.
> > >
> > > Nevertheless the program is crashing so I need to fix it.
> > >
> > > I have now added a CLOSE DATA statement before opening any tables, so presumably there should be no tables open?
> > >
> > > I am not using a DBC database but rather just opening up individual stand-alone tables.
> > >
> > > The code reads as follows:
> > >
> > > CLOSE DATA
> > > SELECT 1
> > > USE table1
> > > SELECT 2
> > > USE table2
> > > SELECT 3
> > > USE table3
> > > SELECT 4
> > > USE table4
> > > SELECT 5
> > > USE table5
> > >
> > > I get the error message "File is in use" on the last line (USE table5).
> > >
> > > How can a file be in use when I have issued a CLOSE DATA statement?
> > >
> > > Also, if I change the order to:
> > >
> > > .............
> > > .............
> > > SELECT 5
> > > USE table5
> > > SELECT 4
> > > USE table4
> > >
> > > then the error message pertains to the USE table4 statement and table5 is actually successfully opened.
> > >
> > > Has anyone got any ideas?
> > >
> > > I'm completely at a loss.
> > >
> > > Thanks in advance.
> > >
> > > Russell.
> > >
> >
> > Well, I don't think this will specifically fix your problem but there are a couple of things I'd add to your code.
> >
> > First of all I'd issue CLOSE DATA ALL or CLOSE TABLES ALL. The ALL is pretty important since it spans all availale work areas.
> >
> > Secondly, it looks like you're opening one table right after another within the same work area. While USE is supposed to close the current table and open the new one, I tend to do things manually. So you might issue a CLOSE TABLES ALL betweeen USE commands. If you want to open all tables in their own separate work area you can issue USE table3 IN 0.
> >
> > ---
> >
> > www.foxite.com - The Home of the Visual FoxPro Experts

Does the same thing happen if you use area 0 each time ie. :
SELECT 0
USE table1
SELECT 0
USE table2
SELECT 0
USE table3
*-- etc. etc.


If that doesn't work can you email a sample of what is happening with sample data ? It's very strange.

Cheers,
Jamie
jamie.osborn@foxite.com

COMPLETE THREAD

CLOSE DATA Posted by Russell Hill @ 4/3/2003 7:05:45 AM
RE: CLOSE DATA Posted by Michael Gill @ 4/3/2003 7:51:47 AM
RE: CLOSE DATA Posted by Russell Hill @ 4/3/2003 7:58:20 AM
RE: CLOSE DATA Posted by Jamie Osborn @ 4/3/2003 8:31:20 AM
RE: CLOSE DATA Posted by Chris Van de Velde @ 4/3/2003 10:40:38 AM
RE: CLOSE DATA Posted by Caij Gomez @ 4/3/2003 11:28:29 AM
RE: CLOSE DATA Posted by Michael Gill @ 4/3/2003 5:32:44 PM
RE: CLOSE DATA Posted by Victor Dinculescu @ 4/3/2003 3:49:17 PM
CLOSE DATA resolved Posted by Russell Hill @ 4/4/2003 1:05:21 AM
RE: CLOSE DATA resolved Posted by Lou Harris @ 4/5/2003 2:32:31 AM
RE: CLOSE DATA resolved Posted by Russell Hill @ 4/6/2003 10:38:56 AM