>
> 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