Connecting to OpenOffice.org s Data Sources


Connecting to OpenOffice.org's Data Sources

MySQL is a common open source database, so we'll use it in our example.

The easiest way to make a connection to a database is to use the built-in OOo Base application to set things up. Then you have the choice of working with your data in Base or linking to the database within Writer or Calc.

Start OOo and select File > New > Database.

On the Database WizardSelect Database screen, enable Connect to an Existing Database and use the dropdown Database type menu to select MySQL (because you're using MySQL). The Database Wizard descriptions and steps show up on the left. Click Next.

Selecting a database.

In step 2, enable Connect Using JDBC. This is the easiest driver to configure. Click Next.

Connecting using JDBC.

In step 3, you can add the database name and server URL. If the MySQL database is running on your machine, you can use "localhost" as the server URL. (Your network or database administrator can help you gain access to a database on another machine. Try to develop a cooperative working relationship with your administrators.) Click Next.

Adding a database name and server URL.

In step 4, you can enter your user name for the database and check the Password Required box. (Talk to your network or database administrators if you need help with this.) Click Next.

Setting up a database user name.

Step 5 finalizes the settings for the Database Wizard by registering your database (posting your database name to the internal OOo connection listing) within OOo. If you have write access to the MySQL database tables, check the Open the Database for Editing box.

Opening the database for edits.

Click Finish.

You can then save the setup to a Base file.

Saving the setup.

After you save the file, the Base application automatically opens, and you can start working with the database records.

The main Base application screen.

Take a look at the records in your database by clicking the Tables icon (in the Database pane) and then the table name (in the Tables pane).

Your data appears in a tabular format.

Viewing your data in table form.

You are now connected to a MySQL database and can work with the records using the OOo Base application. Connections to other databases are created in a similar way. Some of the screens might be a little different, but they generally work the same as MySQL.

You may also want to connect to a spreadsheet or a delimited text file. Instead of using JDBC as the database connection, choose Spreadsheet or Text. Then select the filename and a few other parameters to complete the connection.

Once you've built a connection to your database, Writer and Calc will know about the connection the next time you start them up.

Leave the Base window open. You'll set up some SQL queries in a little while. Use the Window tab to switch back and forth between Base and Writer or Calc files.




Point & Click OpenOffice. org.
Point & Click OpenOffice.org
ISBN: 0131879928
EAN: 2147483647
Year: 2003
Pages: 143
Authors: Robin Miller

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