Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SELECT Command
Collapse the table of content
Expand the table of content

SELECT Command

Activates the specified work area.

SELECT nWorkArea | cTableAlias



Specifies a work area to activate. If nWorkArea is 0, the lowest-numbered unused work area is activated.


Specifies a work area containing an open table to activate. cTableAlias is the alias of the open table. You can also include a letter from A through J for cTableAlias to activate one of the first ten work areas.

By default, work area number 1 is active when you start Visual FoxPro.


Fields in tables open in any work area can be included in Visual FoxPro commands and functions. Use the following formats to access fields in a table open in a work area other than the current one: alias.field or alias -> field.

The following example demonstrates ways of selecting work areas.

OPEN DATABASE (HOME(2) + 'Data\testdata')
SELECT 1     && Work area 1
USE customer  && Opens Customer table

SELECT 2     && Work area 2
USE orders  && Opens Orders table

SELECT customer     && Work area 1

SELECT B     && Work area 2

Community Additions

© 2015 Microsoft