Discussion:
Accessing two .DBC's simultaneously
(too old to reply)
Andy Trezise
2005-04-20 12:51:23 UTC
Permalink
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 17:32:54 UTC
Permalink
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\test55
? 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
-----------------------------------------------------------
Dummy Newgroup name
2005-04-20 20:19:42 UTC
Permalink
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 19:11:38 UTC
Permalink
thanks
Post by Stefan Wuebbe
Post by Andy Trezise
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\test55
? 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.
Post by Andy Trezise
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 19:10:19 UTC
Permalink
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
Post by Andy Trezise
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.
Andy Trezise
2005-04-22 19:11:50 UTC
Permalink
thanks
Post by Anders Altberg
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
Post by Andy Trezise
Hi
I need to open tow databases with the same name and access tables from
each
Post by Andy Trezise
so I can move records from one to the other. How can I alias the database
so
Post by Andy Trezise
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.
Loading...