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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select current database 1

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
If you have more than one database open, any database commands operate on the current one. I know you can change which one is the current one with the pulldown menu on the toolbar, but how do you do it programmatically?
 
Help says that:

SET DATABASE Command

Specifies the current database.

Syntax

SET DATABASE TO [DatabaseName]

Arguments

DatabaseName Specifies the name of an open database to be made the current database. If you omit DatabaseName
, no open database is made the current database.

Remarks

Many databases can be open at the same time, but only one can be the current database. Commands and functions that manipulate open databases, such as ADD TABLE and DBC( ), operate on the current database.

The current database can also be specified by choosing an open database from the Database drop-down list on the Standard toolbar.

Visual FoxPro may automatically open databases when a query or a Form is executed.

SET DATABASE is scoped to the current data session.
 
Sheesh...you would THINK that SET DATABASE would be listed when you click SEE ALSO for OPEN DATABASE. *sighs*

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top