Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: bryan wetton
  Where is bryan wetton?
 Morphett Vale
 Australia
 bryan wetton
 Tags
Subject: RE: opening multiple tables in one routine
Thread ID: 209088 Message ID: 209590 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Monday, December 29, 2008 7:38:40 PM         
   


> Sefan,
>
> Thanks for your suggestion below
>
> >
> > If Not Used(mytable)
> >     Select 0
> >     Use (mytable) 
> > Endif
> > 

>
> However the mystery/problem remains.
>
> After a copy from one folder to another (target folder)I can manually open the copied table by X2 clicking in Windows Explorer and choosing VFP to open the file - thus the copy has succeeded.
>
> After I set default to the target folder I use the debugger.
>
> The following facts exist in the debugger.
>
> 1 curdir() shows me the target folder correctly
>
> 2 sys(5) shows me the correct drive.
>
> 3 The test for the existence of the file - file(myfullypathedfilename) returns a .T. -So VFP knows the dbf file is there.
>
> 4 The alias() is being watched and shows the previously open table ( before the copy routine)
>
> 5 (mytable) is juststem(myfullypathedfilename)
>
> 6 alias() does not show the new table when the USE command in either form is carried out. A browse in the Command Window opens the previous table.
>
> Any further thoughts please?
>

I'm not sure if I got the whole picture -

> 4 The alias() is being watched and shows the previously open table ( before the copy routine)

In your previous posting, your code would get to the "Use (mytable)" line only if the desired alias name is not used.
When you say it is used because the source table is still open with the same alias name that you want to assign to the destination table that you want to open, the "Use (mytable)" line does not run, does it?

If so, I'd suggest to "Close Tables All" after the Copy To attempt and before your code tries to open the destination tables, or to use different alias names.
In addition, your description sounds as if watching Used(mytable) and Dbf(mytable) in the debugger might help.


hth
-Stefan

ENTIRE THREAD

opening multiple tables in one routine Posted by bryan wetton @ 12/24/2008 6:58:11 AM
RE: opening multiple tables in one routine Posted by Brad Schulz @ 12/24/2008 8:09:38 AM
RE: opening multiple tables in one routine Posted by bryan wetton @ 12/25/2008 8:29:48 AM
RE: opening multiple tables in one routine Posted by Brad Schulz @ 12/27/2008 6:59:58 PM
RE: opening multiple tables in one routine Posted by bryan wetton @ 12/28/2008 2:48:51 AM
RE: opening multiple tables in one routine Posted by Stefan Wuebbe @ 12/28/2008 10:26:40 AM
RE: opening multiple tables in one routine Posted by bryan wetton @ 12/29/2008 12:37:26 PM
RE: opening multiple tables in one routine Posted by Brad Schulz @ 12/29/2008 7:26:41 PM
RE: opening multiple tables in one routine Posted by Stefan Wuebbe @ 12/29/2008 7:40:52 PM
RE: opening multiple tables in one routine Posted by bryan wetton @ 12/30/2008 7:59:40 AM
RE: opening multiple tables in one routine Posted by bryan wetton @ 12/30/2008 7:53:24 AM
RE: opening multiple tables in one routine Posted by Stefan Wuebbe @ 12/29/2008 7:38:40 PM
RE: opening multiple tables in one routine Posted by Jyothish KV @ 12/24/2008 8:49:56 AM
RE: opening multiple tables in one routine Posted by Andy Kramek @ 12/24/2008 12:20:17 PM