Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a table without opening Database

Status
Not open for further replies.

AlanArons

Programmer
Aug 1, 2002
91
US
Is it possible to get the data from a table contained within a database without opening the database.

I am working with an app that has its own database. I would like to access data in another db but dont want have to close the current db and then reopen all the files after I get what I want.

Any ideas?

Alan Arons [ponder]
 
VFP doesn't limit you to a single open database, so just go ahead and get what you need. The data you already have open will stay open.

Tamar
 
If you are using data tables from multiple VFP databases concurrently, remember to USE a table set the specific database to the the table's 'container'.
Code:
OPEN DATABASE DBC1
OPEN DATABASE DBC2

SET DATABASE TO "DBC1"
USE DBC1Table IN 0

SET DATABASE TO "DBC2"
USE DBC2Table IN 0

OR
Specify the database which contains the table within your USE command.
Code:
OPEN DATABASE DBC1
OPEN DATABASE DBC2

USE DBC1!DBC1Table IN 0
USE DBC2!DBC2Table IN 0

SELECT DBC1Table
<Do Whatever>

SELECT DBC2Table
<Do Whatever>

Good Luck,
JRB-Bldr
 
Thanks guys

This is exactly what I was hoping for.

Alan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top