[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|               USE               |
+---------------------------------+
USE [<file> | ?]
        [IN <work area>]
        [AGAIN]
        [INDEX <index file list> | ?
        [ORDER [<expN>
        | <.idx index file>
        | [TAG] <tag name>
                [OF <.cdx file>]
        [ASCENDING | DESCENDING]]]]
        [ALIAS <alias>]
        [EXCLUSIVE]
        [NOUPDATE]

-----------------------------------
Opens a database in the selected work area.
-----------------------------------

<file> | ?
        <file> is the database to open.  If you specify ?, the Open File dialog
appears with a listing of available databases to choose from.  If USE is
issued without a <file> and a database is open in the selected work
area, the database is closed.  A database is also closed when another
database is used in the same work area.

IN <work area>
        Opens a database in an unselected work area.  To close a database in
another work area, issue USE without a file name and including IN <work
area>.

AGAIN
        Opens a database file in concurrently in another work area.  When you
use a database again, index files opened for the original database are
also available and the database in the new work area takes on the file
attributes (e.g., read-only, exclusive) of the database in the original
work area.

INDEX <index file list> | ?
        Opens index file(s) with the database.  Files in the <index file list>
should be separated by commas.  You don't need to include file
extensions for index files unless an .IDX and a .CDX index file in the
list have the same base name.  To open a single index file, include its
name in the <index file list> or specify INDEX ? to display the Open
File dialog.

        The first file in the <index file list> becomes the master index file
that controls how records are accessed.  If the first index file is a
.CDX compound index file, the database file is displayed and accessed in
physical record order.

ORDER [<expN>]
        <expN> refers to index files as they appear in <index file list> and
designates a master tag or master index file other than the first index
file in <index file list>.  .IDX index files are numbered first in the
order they appear in the <index file list>.  Tags in the structural
index file (if one exists) are then numbered in the order the tags were
created.  Finally, tags in any independent .CDX compound index files are
numbered in the order they were created.

        If <expN> is 1, the database file is displayed and accessed in physical
record order, but the index files remain open.  ORDER 0 allows open
index files to be updated while presenting the file in record number
order.   ORDER without additional arguments is identical to ORDER 0.

ORDER [<.idx index file>]
ORDER [[TAG <tag name>] [OF <.cdx file>]]
        To explicitly designate an .IDX index file as the master index, include
the name of an <.idx index file>.  To explicitly designate a tag of a
.CDX index as the master tag, include <tag name>.  <tag name> can be
from any open .CDX.  If identical tag names exist in open .CDX files,
include OF <.cdx file> to name the .CDX containing the desired tag.

ASCENDING | DESCENDING
        Specifies whether database records are displayed and accessed in
ASCENDING or DESCENDING order.  The index file or tag is not changed,
only the order in which records are accessed is changed.

ALIAS <alias>
        Creates an <alias> name for the database file opened with USE.  If
ALIAS isn't included in USE the alias defaults to the name of the
database file.  An alias can consist of up to 10 letters, digits or
underscores, and must begin with a letter or an underscore.

        If you don't specify an alias each time you open a database with USE
AGAIN, a default alias is assigned automatically.

EXCLUSIVE
        For FoxPro/LAN users, opens a database for exclusive use on a network.
For more information, see SET EXCLUSIVE.

NOUPDATE
        Prevents changes to the database, including changes to the structure of
the database with MODIFY STRUCTURE.  You can, still view the database
structure.

+---------------------------------+
|             Example             |
+---------------------------------+
CLOSE ALL
SELECT 1
USE payments ORDER date
SELECT B
USE invoice
USE customer IN 3

? DBF()

? DBF(1)

? DBF(3)


In this example, three databases are opened in three work areas.  DBF()
returns the names of the files open in each work area.

-----------------------------------

See Also:  CREATE, CLOSE, DBF(), INDEX, SELECT, SET INDEX, SET ORDER

-----------------------------------

See Also: CREATE CLOSE DBF() INDEX SELECT SET INDEX SET ORDER
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson