Accessing ODBC data sources from StarOffice
Contents
Introduction
This article describes how to use StarOffice with any Easysoft ODBC driver.
Easysoft ODBC drivers have been tested with StarOffice 8 on Red Hat 9.0 (which includes unixODBC 2.2.3).
StarOffice can use ODBC data sources to link to external data. StarOffice appears to attempt to load libodbc.shared_extension
to use as the ODBC Driver Manager.
To use an Easysoft ODBC driver with StarOffice, ensure that the unixODBC Driver Manager is installed and that the Easysoft ODBC driver is installed as an ODBC driver under unixODBC. If unixODBC is not installed already, install the version that comes with the Easysoft ODBC driver distribution. StarOffice is built with threads, so if you build unixODBC yourself, use --enable-threads=yes
on the configure line. If you're using the ODBC-ODBC Bridge, make sure that you specify the thread-safe ODBC-ODBC Bridge client driver (OOB_r
) when creating data sources for use with StarOffice. For earlier ODBC-ODBC Bridge releases, the thread-safe client is contained in distributions that contain -mt
in their file name.
Before trying to use ODBC in StarOffice, create an ODBC data source and test it with unixODBC's isql utility.
If you have the GUI unixODBC programs (you need QT for these), you can use ODBCConfig to create Easysoft ODBC driver data sources. Otherwise, you'll have to edit the unixODBC odbc.ini
file to add data sources. For information about adding an ODBC-ODBC Bridge data source, refer to DSN_definition.txt
and example_odbc.ini
in the install_dir/easysoft/oob/doc
directory or the ODBC-ODBC Bridge documentation. For information about adding a data source for a different Easysoft ODBC driver, refer to the documentation for your Easysoft ODBC driver.
After you have created your data source and tested it with isql, you can use it from StarOffice applications such as Base, Calc, and Writer.
Using ODBC data sources in StarOffice
- Choose File > New > Database.
- Choose Connect to an existing database.
- Choose ODBC in the list, and then choose Next.
- Choose Browse, double-click your data source, and then choose Next.
If your data source is not listed, check the
odbc.ini
file. - If your database requires a database user name, enter it in the User name box. If this user needs to supply a password, select the Password required check box.
- Choose Finish.
- Save the database when prompted.
The database opens in a new Base window. From here you can access your data.
- In the left pane of the database window, choose the Tables icon to display a hierarchy of tables. Enter the database password if prompted, and then choose OK.
- To retrieve the data in a table, in the Tables pane, double-click a table.
- Choose the Queries icon to create a query.
Use any of the methods listed in the Tasks pane to create a query.
Red Hat 8.0 specific notes
Red Hat 8.0 comes with unixODBC 2.2.2, which is installed with a --prefix
of /usr
. As a result, odbcinst is in /usr/bin/odbcinst
and libodbc.so
is in /usr/lib
. ODBC-ODBC Bridge distributions before 1.1.0.4 do not expect to find unixODBC in these places and will ask if you have unixODBC installed and where it is.
The unixODBC that comes with Red Hat appears to have been built with --sysconfdir=/etc
, so the odbc.ini
and odbcinst.ini
files should be in /etc
.
When you install the ODBC-ODBC Bridge (pre 1.1.0.4) on Red Hat 8, it may fail to locate the existing unixODBC, in which case you have these alternatives:
- Accept the fact the ODBC-ODBC Bridge installation does not find the existing unixODBC and answer
Yes
to install the unixODBC that comes with the ODBC-ODBC Bridge. All the ODBC-ODBC Bridge installation needs is odbcinst andlibodbcinst.so
to install the ODBC-ODBC Bridge driver into unixODBC. Once the ODBC-ODBC Bridge is installed under unixODBC, you can delete/usr/local/easysoft/unixODBC
. - When asked if you already have unixODBC installed, choose
Yes
and enter/usr
as the path to unixODBC. This will use your existing odbcinst to install the ODBC-ODBC Bridge (no difference to 1). When asked if you want to install the ODBC-ODBC Bridge as an ODBC driver under unixODBC, answerYes
.