Tables

Tables show data organized into rows and columns. Every row in a table is a record. Every column in a table is a field. We will use the words "row" and "record" interchangeably. We will also use the words "column" and "field" interchangeably.

images/tbl_tables_eg01.png

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.

images/sc_tables_nwind_01.png

The illustration above, for example, shows a project with tables imported from the Microsoft Northwind Traders example database shipped with Microsoft Access.

images/sc_tables_nwind_02.png

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
images/icon_table.png

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.
images/icon_table.png
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.
images/icon_table_linked.png
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.
images/icon_sql.png
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.

Note that all of the above tables can be opened in table windows and manipulated using essentially identical methods. Tables that are linked to drawings can be opened in their own windows just like any other table, and often are. The only difference between tables linked to drawings and other tables is the dynamic tie between drawings and their tables. Every object in a drawing is represented by a record in the table. A selection made in the drawing appears in the table and vice versa. Deleting an object or a record in the table will immediately take effect in the linked component as well. See Drawings and Tables for examples.

Three Ways to Import or Link Tables

Once a table is imported into a Manifold project the table and the data it contains are managed by the Manifold database engine. However, the process of opening external database files or providers and getting data from them into Manifold is managed with Microsoft technologies embedded within Manifold. When external tables are linked into a project (instead of being imported) the Microsoft routines will be used to manage access to those tables.

Manifold includes three Microsoft data access technologies for importing or linking to external tables:

All three data access technologies are included even though their capabilities overlap when working with simple files. By providing all three methods Manifold provides users with convenience, reliability and flexibility.

Jet is the database engine used by Microsoft within Microsoft's own Access database products. The File - Import - Table menu choice uses Jet to open simple file types and to import their tables and data into the Manifold project. Providing Jet within Manifold allows users to open simple database file formats that are frequently encountered in Microsoft Office installations.

images/dlg_import_table_filestype.png

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:

images/dlg_tbl_oledb_providers.png

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

See Also

Examples Used

Many of the illustrations for tables are screen shots made using the Nwind.mdb sample database provided by Microsoft. This is a version of the Northwind.mdb sample database distributed with Access and thus familiar to many Microsoft Office users. Nwind.mdb is provided on the Manifold System CD as a sample.

Back to Manifold Home Page