835.txt
=====================================================================
Transfer Forms Between Databases
=====================================================================
PRODUCT: R:BASE VERSION: 5.5 or Higher
=====================================================================
CATALOG: Forms, Reports & Labels AREA : Forms
=====================================================================
You can use the new multi-database connect feature of R:BASE 5.5 for
DOS to quickly and easily transfer forms, reports, and other data
between databases. The multi-database connect allows you to connect
to and attach tables from other R:BASE databases. The attached tables
operate in the host database just like any other R:BASE table.
The following steps demonstrate how to transfer a form from another
database. You can easily adapt the same steps to transfer reports or
data from your data tables.
1. Start R:BASE 5.5 for DOS and connect to the host database. This is
the database into which you want to transfer the form.
Note: When you connect to another R:BASE database, the character
settings for QUOTES, SINGLE, and MANY in the host database must be
the R:BASE defaults of single quote ('), underscore (_), and percent
(%) respectively.
2. Connect to the other database. This is the database the form will
be copied from. You use the new SCONNECT command to connect to
another database.
SCONNECT dbname2
3. Attach the system table SYS_FORMS using an alias name. The new
SATTACH command is used to attach tables from the other database and
make them accessible in your host database. Because your database
already has a table named SYS_FORMS, you must give the attached
SYS_FORMS table a different name.
SATTACH SYS_FORMS AS otherforms
In the host database you now have a table named SYS_FORMS that holds
currently defined DOS-style forms for the host database and a table
name otherforms that holds the DOS-style forms from the other
database.
4. Transfer the form using an INSERT command. The form is transferred
from the attached SYS_FORMS table (named otherforms) to the host
database's SYS_FORMS table.
INSERT INTO SYS_FORMS SELECT * FROM otherforms WHERE SYS_FORM_NAME
= 'formname'
5. After you have transferred the desired forms, remove the attached
SYS_FORMS table from the host database.
SDETACH otherforms
When you disconnect the host database, the connection to the other
database is automatically released. You can also use the SDISCONNECT
command to disconnect the other database at any time.
That's all there is to it. To transfer reports and labels, just
reference the appropriate system table, SYS_REPORTS or SYS_LABELS.
You must attach system tables with an alias name.
To transfer data from one of your data tables, just attach the table
if the table name is unique. If the table name is already used by a
table in the host database, you must use an alias name. If the
attached table contains columns that have the same name as columns in
the host database, the columns must also have the same data type.
R:BASE can't include columns that have the same name but different
data types.
For more information about working with multiple R:BASE databases,
refer to the Foreign Data Sources entry in the "Reference Manual".