Tables and Drawings
Every drawing in Manifold has a table associated with it. Each object in the
drawing (that is, every point, line or area object in the drawing) is linked to
a row in the table. Drawings have a table even if there is no data saved
for each object. In that case, the drawing's table is mostly empty. It has only
one field, the object ID field, for each row. The object ID field is used to link each row to its associated object and cannot be edited.
It is indicated as the key field with a small key icon in the column name.
Deleting an object in a drawing will delete the object's record in the
drawing's table. Deleting a record in a drawing's table will delete the associated
object in the drawing.
Other Tables
Tables may also be database tables that are imported into a Manifold project
or linked into the project from an external database source. New tables may
also be created with Manifold.
Tables may be brought into projects from almost any database, even from those
that have nothing to do with drawings or maps. We will often work with tables
that have no geographic context. We may wish to prepare data for later use
together with drawings and maps, or we might simply wish to use Manifold as a
general-purpose means of viewing, analyzing, exploring and managing databases.
The illustration above, for example, shows a project with tables imported from
the Microsoft Northwind Traders example database shipped with Microsoft Access.
If we open the Customers table we see the same data familiar to many Access users who have worked with
this sample database.
Tables and Queries
Both tables and queries appear as tables when opened in a table window.
Manifold has several types of tables that may appear in a project and that are
created in different ways.
|
| Type
| How Created
|
| Tables linked to drawings.
| Created whenever the drawing is imported or created. Each object in the
drawing will be automatically linked to one row in the table.
| |
| Tables that have been imported into the project.
| Created using File - Import - Table to directly open simple Microsoft database files or to open databases via OLE
DB providers or ODBC drivers.
Importing a table brings the entire content of the table into the project. | |
| Tables that are linked to external files or database providers.
| Created using File - Link - Table to link to simple Microsoft database files or to link to database tables
outside the project via OLE DB providers or ODBC drivers.
Linking to a database table outside the project leaves the data outside of the project where other programs can continue to work with it. | |
| Tables that are created by queries.
| File - Create - Query creates the query, and then right clicking on the query and choosing Edit allows us to enter an SQL query. Double clicking on the query (or choosing Open in the context menu) will "run" it so that it appears as a table in a table
window.
Queries can reference any table in the project, even those that are linked to external files or providers. |
With the Import dialog, different formats may be opened by simply choosing the desired
database type in the Files of type list as shown above. Using Jet also provides high reliability since this is
Microsoft's own code used to open simple Microsoft file types that are widely
used throughout Office and similar applications.
Choosing ODBC data sources in the files of type box will allow us to connect to a data source using ODBC
drivers that are on our system. Most databases, especially older types such
as Btrieve, may have ODBC drivers even if they have not been updated with OLE DB drivers.
OLE DB is a newer, faster, more flexible technology that allows general connection
to any database system for which there is an OLE DB provider. OLE DB is now
superceding the older ODBC methodology. Importing using the File - Import Table menu choice with files of type OLE DB will use the OLE DB system. This method can also be used for simple file
types by using the OLE DB provider for Jet.
OLE DB or ODBC provide great flexibility, since they are methods of connecting
to any database file or provider for which we have an OLE DB or ODBC driver on
our system. If we install Microsoft upgrades or new Microsoft products on our
computer that install newer OLE DB providers, Manifold automatically will be
able to take advantage of the new providers.
Manifold installs the standard suite of Microsoft OLE DB providers:
There is one OLE DB provider of special interest for legacy database access.
The Jet 4.0 OLE DB Provider essentially duplicates the capabilities of Manifold's built-in copy of Jet.
Using it is equivalent to using Jet via the File - Import - Table menu choice.
Jet, OLE DB or ODBC can be used to import tables and their data into projects
or to link to tables for which the data remains in external files or providers.
Once a table is imported into a project the Manifold database engine takes over all management of the
data. Therefore, once a table is imported there is no difference between
tables regardless of whether Jet or OLE DB or ODBC was used for the import.
However, if tables are linked into a project and their data remains in external files or providers, then
whichever method (Jet, OLE DB or ODBC) was used for the linkage will continue to
be used to access the tables and the data they contain. In addition,
performance and other characteristics will be subject to the advantages or limitations
of whatever file format or provider is being used.
OLE DB provides an advantage when linking external tables from sophisticated
providers such as SQL Server or Oracle. In that case, the Database Console for tables can be used to provide direct access to the command language used
by the provider. The Database Console allows interactive browsing of external
databases with toolbar buttons to link or import tables. The Database Console
also allows execution of commands (typically SQL) within the external
database. Manipulating Oracle by speaking to it in SQL / DDL / DML is not everyone's
cup of tea, of course, but the possibility is there for expert users within the
Database Console when using OLE DB.
Linking to External Tables and Multi-User Applications
When linking to an external file or provider used by multi-user applications
Manifold will participate correctly in any multi-user accesses that might go on
simultaneously from other applications. This is true for Jet, OLE DB and ODBC
connections.
For example, if we link to a table in an external SQL Server database some
other person or process could simultaneously open that table with SQL Server over
our corporate network as well. They could access the table from a different
machine and work on it from that other machine even as we continue to work on the
same table with Manifold. Any updates or changes done by Manifold will be
consistent with any locking or other protocols designed to maintain order in
multi-user applications. This allows Manifold users to work with external
databases from within Manifold even as they are being used by different applications.
Choose the data access method carefully when embarking on demanding multi-user
applications. For example, although Jet may be used for multi-user operations
with .mdb Access files it is not as robust and reliable a system for multi-user work as
is SQL Server. Manifold users can always use the SQL Server desktop engine
installation available on the Manifold CD to create highly robust multi-user
capable database tables.
Linking Drawing Data Attributes to External Tables
So far we've seen that every drawing is linked to a table and that the
drawing's table is created within the project at the same time the drawing is created.
All such tables exist entirely within the project. Some times we would
like to link our drawing to an external table that is linked into the project.
Perhaps, for example, we have a drawing of European countries and we would
like to color those countries with a thematic format that uses our company's sales
for each country. If the company's sales are saved in a table in some
corporate server it would be nice to link that external table to the drawing so that
every time we open the drawing window the colors in the thematic format are
taken from the actual sales recorded on that moment in the corporate server.
To do this we use a relation to link the drawing's table with an external table. Fields from the external
table may then appear within the drawing's table. See the Attaching External Tables to Drawings topic.
Tips