![]() |
![]() ![]() |
|
Visio's Database Links Linking Visio drawings with an external database is useful for automatically generating Visio drawings or to share data stored in a Visio drawing. What is a Database?
Database software, however, is capable of advanced sorting and data output. For example, you could ask the database software to produce a list of all employees with a birthday in August, sort by the list by dates, then print the list of names by date. The data can be output to the screen, the printer, to a file on disk, or to another program -- such as Visio. When it comes right down to it, a database simply consists of rows of data (called records). Every record contains exactly the same types of data (called fields) in precisely the same order. For example, here are three records, each containing four fields:
By looking at these records, you can guess that field #1 contains a first name. Field #2 contains a location, such as a city name. Field #3 contains an amount, perhaps the monthly salary. Field #4 contains a toggle -- yes or no -- perhaps indicating whether the person has access to the executive bathroom. I present to you the table again, this time adding in the database structure:
If you are familiar with spreadsheets, then you may notice that this database table looks very much like a spreadsheet, with rows and columns.
Indeed, recall that Visio uses a spreadsheet-like interface to display its shape data in ShapeSheets. Keep the similarity in mind: only the terminology is different. The ShapeSheet rows are called records in the database; the ShapeSheet cells are called fields in the database; the ShapeSheet itself is called the table in the database. One other important term you need to know is key. The primary key is a field that uniquely identifies each record. If you are familiar with database software, then you should know about Visio's limitations. Visio only sees a flat table of rows and columns of data; it cannot make relational database queries. Visio has only three data types, as discussed later. Visio cannot execute SQL commands directly; it is possible to do this indirectly. Visio is limited to connecting one record to one shape; you cannot connect two or more records to a shape. A future version of Visio may eliminate these restrictions. Reasons for Making the Connection
Other examples include facilities management (keep track of furniture and other corporate assets) and centralized master generation. You can probably think of your own examples. Perhaps the most important thinking you need to do is whether to store the data in the Visio drawing or in the external database. Here is the difference: you might want to store the data in the external database when the data needs to be shared among other users and other software applications. The Visio-database connection is more powerful than simply showing data graphically. You can control the database from Visio, such as adding and deleting records. You can even create new database files from Visio. This is pretty exciting stuff! Visio and ODBC Before the advent of ODBC, a software program, such as Visio, needed an interface driver for every database program. A driver is a piece of software that lets a program communicate with another program or hardware. (You are probably familiar with hardware drivers that let Windows communicate with your computer's graphics board, CD-ROM, or network card.) Pre-ODBC you would have one database driver for dBase, another database driver for Sybase, another database driver for Paradox, and on and on. It was a pain for software developers to write a driver for every database program, then have to update every driver each time the software was upgraded. For this reason, Microsoft invented ODBC. Pretty much all Windows-based database programs convert their proprietary data format to ODBC format. Examples include Paradox, Oracle, Access, dBase, Alpha Four, SQL Server, and Sybase. Excel contains a limited form of ODBC; for example, Excel cannot be made to delete a record via ODBC. Visio says they heard of one customer who managed to get ODBC working between Visio running under Windows and dBase II running on a mainframe computer! Similarly, a number of non-database Windows applications have ODBC, such as AutoCAD, MicroStation, Lotus Notes, and Visio. These programs can read ODBC data and can control ODBC-compatible databases. Caution: ODBC might not be installed on your computer. The appropriate ODBC components and database drivers are only installed if you choose the Complete option when installing Visio. All versions of Visio, including Visio Standard, support ODBC. Which Database Program?
You heard right: to connect a Visio drawing with a database file, you don't need a database program. That's because Visio includes everything you need to create the database file from within Visio. Visio has an option to create an Access-compatible database file. It is only when you want to access (pardon the pun) the database file from outside of Visio that you might need the database program. However, if you want to dabble with an actual database program, you have several low-cost choices. If you have Microsoft Office, you can begin with the Excel spreadsheet program. Microsoft Office Professional includes the Access database program. Otherwise, there are a number of low-cost database programs that are dBase II-compatible, such as Alpha Four. Some of these are available in free demo version, which are only limited by the size of database you are allowed to create. In Part II, I'll describe how Visio makes the connection with external database programs. This article was adapted from "Visio 5.0 for the Advanced User" with permission of WordWare Publishing, Ltd.
|
|
|
Copyright © 1998-2007 DBM & others | Disclaimer | Privacy | Re-publication | Trademarks | Webmaster | Home |