Connecting to MS Office


In this section, you learn how to connect MS Office to PostgreSQL, and about the features and dangers users have to face.

Setting Up the ODBC Driver

The first step you take when working with PostgreSQL and ODBC is to set up the ODBC driver for Windows. ODBC drivers for various databases are usually distributed with Windows. The PostgreSQL driver, however, is not included in the Windows core distribution, so the driver has to be installed manually. Installing the driver is a simple task.

First you download the driver. Check out http://odbc.postgresql.org to download the software. One of the fastest European mirrors is situated at the Technical University of Vienna:

ftp://gd.tuwien.ac.at/db/www.postgresql.org/pub/odbc/versions/

Check out the lastest ZIP file in the full directory and unzip the archive. The ZIP archive contains one Windows executable application that you can start from WinZip. The installation process of the ODBC driver is easy: Click through the install script and answer all questions. You don't have to define a path , because everything is done by the install script (see Figure 19.1).

Figure 19.1. The installation screen.

graphics/19fig01.gif

After installing the ODBC driver on the system, all required files for establishing an ODBC connection to PostgreSQL under Windows are available on the system. The next step is to define the data sources you will need. Click the Start button of your Windows desktop and open the Control Panel. In this menu, you will find an icon for configuring ODBC. Open the tool and look for your PostgreSQL driver. You have to add a data source to access PostgreSQL from your Windows applications.

Figure 19.2 shows how you connect to the database called myodbc on 195.34.147.7.

Figure 19.2. Defining the basic connection parameters.

graphics/19fig02.gif

In this window you can define the basic parameters for your ODBC connection. Now you move on to the Advanced Options (Driver) dialog box (see Figure 19.3).

Figure 19.3. Setting the advanced options.

graphics/19fig03.gif

One of the most important check boxes is labeled ReadOnly. If it is checked, the database cannot be updated, because it is set to read-only mode. Checking this box is a common error if you are not use to connecting to PostgreSQL from a Windows host. Keep this in mind when configuring your system and building applications. All other settings you can configure in this screen are not as important as the ReadOnly flag. Configurations such as query optimizations should be set to the default value. For further information about these settings, check out the documentation of the driver.

The next window shows some additional parameters you can define for your connection. Again, make sure that ReadOnly is not checked (see Figure 19.4).

Figure 19.4. Make sure the ReadOnly button is not checked.

graphics/19fig04.gif

Setting up the ODBC driver and defining the data source is an easy task, and in general no significant problems will occur as long as you read what is displayed on the screen by the software.



PostgreSQL Developer's Handbook2001
PostgreSQL Developer's Handbook2001
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 125

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net