Name: ATTACH Shortest: ATT
Family: Command Category: Server Access
Description: Use the ATTACH command to attach a dBASE™ file to an open R:BASE database.

Syntax


ATTACH syntax diagram

Options

filespec
A dBASE database name with a drive and path specification in the form D:\PATHNAME/FILENAME.

ndxlist
Specifies a list of index files to associate with the specified dBASE file. You do not have to include the extension for each index file. Separate index file names with a comma (or the current delimiter). Index files must be located with the specified dBASE file.

USING
Removes dBASE index files that were previously associated with the attached dBASE file when this option is used without a list of index files.

About the ATTACH Command

Before you can attach a dBASE file, an R:BASE database must be open. You can open an existing database or use the CREATE SCHEMA command to create a database.

Include the file specification when the file is located on a different drive or directory. You do not have to include the .DBF extension for the dBASE file.

R:BASE directly reads and writes dBASE III and dBASE III PLUS data and index files. R:BASE can also read and write dBASE IV data files and index files that have the .NDX extension, just as dBASE III and dBASE III PLUS can share files with dBASE IV. R:BASE cannot read encrypted files nor read and write to dBASE IV index files, which have .MDX extensions.

Attaching to dBASE Files from a Network

From a network, R:BASE, dBASE III, and dBASE III PLUS users can access the same file at the same time. R:BASE can lock a dBASE file just as dBASE III and dBASE III PLUS can lock a dBASE file. When R:BASE is in multi-user mode, it does not support dBASE IV use. When a dBASE IV file is open by dBASE, R:BASE cannot access that file; when R:BASE attaches to a dBASE IV file, that file cannot be accessed by dBASE IV.

Listing dBASE Files

Use the LIST command to list the dBASE files in an R:BASE database. R:BASE displays DBF in the Rows column to indicate a dBASE file.

Reattaching dBASE Files to R:BASE

A dBASE file stays attached unless you use the DETACH command, which removes a dBASE file and its associated index file from the R:BASE database. The dBASE files stay attached because R:BASE remembers the attached dBASE files and index files when you open a database. At that time, R:BASE searches the current directory and path to find the attached dBASE file; therefore, the location of the dBASE files must be included in your path.

Associating and Modifying dBASE Index Files

You can associate a maximum of seven dBASE index files, which have .NDX extensions, with a dBASE data file by using the ndxlist option. R:BASE remembers each index file you associate with the dBASE data file. Also, use the ndxlist option to modify or preserve a set of indexes. If you issue another ATTACH command with a list of index files, R:BASE removes the current index files from the dBASE data file and associates the new list with the dBASE data file.

R:BASE updates the information stored in the dBASE data and index files each time you add or edit information in a dBASE file.

R:BASE Commands that Work with dBASE

The following R:BASE commands work with dBASE files. Limitations are noted following the table.

Commands that Work with dBASE
ATTACH DROP LABEL LIST CURSORS RENAME FORM
BROWSE DROP REPORT LIST DATABASES RENAME OWNER
CHOOSE DROP RULE LIST FORMS RENAME REPORT
COMMENT ON DROP TABLE LIST LABELS RENAME VIEW
COMMIT4 DROP VIEW LIST REPORTS REPORTS
COMPUTE EDIT LIST RULES REVOKE
CONNECT EDIT DISTINCT LIST TABLES ROLLBACK4
CONTINUE EDIT USING LIST VIEWS RULES
CREATE VIEW ENTER USING LOAD SELECT
CROSSTAB FETCH OPEN CURSOR SET
DECLARE CURSOR FUNCTIONS PACK1 SHOW
DELETE GRANT PRINT TALLY
DELETE DUPLICATES INSERT INTO PROJECT2 UNLOAD3
DETACH LBLPRINT QUERY UPDATE
DISCONNECT LIST ACCESS RBLABELS WHENEVER
DROP CURSOR LIST ALL RELOAD ZIP
DROP FORM LIST COLUMNS RENAME COLUMN  
  1. dBASE files are not affected when you use a PACK command.
  2. Using the PROJECT command, you can create a new table from an existing table from dBASE to R:BASE, but not from R:BASE to dBASE.
  3. You can unload dBASE tables as ASCII only.
  4. You cannot modify dBASE tables when transaction processing is on.
Note: dBASE memo fields can be 64K in size. If the dBASE memo field is larger than 4K (the maximum size of an R:BASE note column), R:BASE reads as much as will fit. If you make changes and then write the record back to dBASE, the existing dBASE memo field is overwritten. The Carriage Return and Line Feed characters in dBASE are mapped to [Alt] + [0255].

R:BASE Commands that Do Not Work with dBASE

The following commands do not work with dBASE files in R:BASE.

Commands that Do Not Work with dBASE
ALTER TABLE1 CREATE INDEX ON JOIN
APPEND CREATE SCHEMA AUTHOR RENAME TABLE
AUTONUM CREATE TABLE RESTORE
BACKUP ALL DROP COLUMN SUBTRACT
BACKUP DATA DROP INDEX UNION
BACKUP STRUCTURE INTERSECT  
  1. Column names for dBASE files can be changed with ALTER TABLE.
Example

In the following example, the first command opens the concompdatabase. The second command attaches the dBASE file SAMPGATE to the concomp database and associates the dBASE index files COMPID and PRODDESC with the R:BASE file table sampgate.

CONNECT concomp ATTACH sampgate USING compid, proddesc