|
Home > Archive > FoxPro database connector > April 2005 > Accessing two .DBC's simultaneously
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Accessing two .DBC's simultaneously
|
|
| Andy Trezise 2005-04-20, 9:25 am |
| Hi
I need to open tow databases with the same name and access tables from each
so I can move records from one to the other. How can I alias the database so
that I can be sure that I'm opening the correct table? Also....how can I
close just one of the databases - CLOSE DATABASES seems to do all open
databases.
| |
| Stefan Wuebbe 2005-04-20, 1:24 pm |
|
"Andy Trezise" <andy@work.com> schrieb im Newsbeitrag
news:eAOC0baRFHA.244@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I need to open tow databases with the same name and access tables from each so I
> can move records from one to the other. How can I alias the database so that I can
> be sure that I'm opening the correct table?
Hi, you can use a path with the Use command, and maybe an
additional Alias name. Same goes with Open and Set Database To
CREATE DATABASE test55
CREATE DATABASE someOtherFolder\test
55
? DBC()
SET DATABASE TO (CURDIR()+'test55')
? DBC()
Nevertheless, I'd guess it might be easier to do what you want in two
steps, i.e. do a bunch of "Select * From tableA Into backupA"
statements or similar and then do not open the new database until you
have Close Databases All, Set Path To etc.
> Also....how can I close just one of the databases - CLOSE DATABASES seems to do all
> open databases.
Works for me - by omitting the ALL clause it closes the current DBC
(and its tables and views) only, but not a second one.
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| Anders Altberg 2005-04-20, 8:25 pm |
| You can't alias a database.
You can switch between the two by using OPEN DATABASE path\name, so SET
DATABASE TO <name> is not required.
ADATABASES(aDBC) stores then names and path of any open databases.
DBC() returns the path\name of the currently default database.
SET DATABASE TO aDBC(2,1) would also a switch to that one and not to
aDBC(1,1) even if they are named the same.
-Anders
"Andy Trezise" <andy@work.com> wrote in message
news:eAOC0baRFHA.244@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I need to open tow databases with the same name and access tables from
each
> so I can move records from one to the other. How can I alias the database
so
> that I can be sure that I'm opening the correct table? Also....how can I
> close just one of the databases - CLOSE DATABASES seems to do all open
> databases.
>
>
| |
| Dummy Newgroup name 2005-04-20, 8:25 pm |
| Yes, I wanted to do that and alias the databases, but it doesn't
work.
You have to identify them with their paths, and give the tables that
you open from each different aliases.
At least, I think that's what I concluded.
Regards
Mark
| |
| Andy Trezise 2005-04-22, 8:24 pm |
| thanks
"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:uKmSe9cRFHA.3708@TK2MSFTNGP15.phx.gbl...
>
> "Andy Trezise" <andy@work.com> schrieb im Newsbeitrag
> news:eAOC0baRFHA.244@TK2MSFTNGP12.phx.gbl...
>
> Hi, you can use a path with the Use command, and maybe an
> additional Alias name. Same goes with Open and Set Database To
> CREATE DATABASE test55
> CREATE DATABASE someOtherFolder\test
55
> ? DBC()
> SET DATABASE TO (CURDIR()+'test55')
> ? DBC()
>
> Nevertheless, I'd guess it might be easier to do what you want in two
> steps, i.e. do a bunch of "Select * From tableA Into backupA"
> statements or similar and then do not open the new database until you
> have Close Databases All, Set Path To etc.
>
>
>
> Works for me - by omitting the ALL clause it closes the current DBC
> (and its tables and views) only, but not a second one.
>
>
>
> hth
> -Stefan
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
| |
| Andy Trezise 2005-04-22, 8:24 pm |
| thanks
"Anders Altberg" <x_pragma@telia.com> wrote in message
news:eQ8tI$dRFHA.252@TK2MSFTNGP12.phx.gbl...
> You can't alias a database.
> You can switch between the two by using OPEN DATABASE path\name, so SET
> DATABASE TO <name> is not required.
> ADATABASES(aDBC) stores then names and path of any open databases.
> DBC() returns the path\name of the currently default database.
> SET DATABASE TO aDBC(2,1) would also a switch to that one and not to
> aDBC(1,1) even if they are named the same.
> -Anders
>
> "Andy Trezise" <andy@work.com> wrote in message
> news:eAOC0baRFHA.244@TK2MSFTNGP12.phx.gbl...
> each
> so
>
|
|
|
|
|