E-Mail:

Hooking OOo to MySQL

Now this is something that I did not know! According to this article from NewsForge, you can indeed setup OpenOffice to connect to a SQL Database.

Did you know that you can connect the OpenOffice.org office suite to a MySQL database? By combining the power of these two open source applications you can do things like generating personalized sales letters from the customer data stored on your servers. Let’s walk through the process using OOo’s database wizard.

* Start OOo and click File, New, and Database.
* On the Database Wizard screen, click the “Connect to an existing database” button and use the drop down “Database type” menu to select MySQL. Click Next.
* Click on the “Connect using JDBC” radio button (it’s the easiest driver to use), followed by the Next button.
* Add a database name and the server URL. For a MySQL database that is running on your own machine, use localhost. I used the default MySQL JDBC driver class of com.mysql.jdbc.Driver and it worked fine. If you want to access a database on another machine, your network or database administrator can give you the necessary details. Click Next.
* Type in the user name for the database and check the “Password required” box. Obviously, you’ll need a user name and password to get to the MySQL database. Click Next.
* Now you can finalize the settings for the database wizard and register your database within OOo (post your database name to the internal OOo connection listing). If you have write access to the MySQL database tables, you can also check the “Open database for editing” box. If you have write access and can’t edit any fields, make sure that the table you want to access has a primary key (not null and unique) defined. Click Finish.
* Save the setup to an OOo Base file.
* After you save the file, the Base application will automatically open and you can start to work with the database records. The next time you log in, it will ask you for your user name and password. [Read the rest]

One Comment

I was easily able to remotely connect OpenOffice to MySQL across our network via the JDBC connector/ OOo file I built and do the desired queries. The problem I’m having is that no one else is able to either use the the file I built or build their own to connect. Is there some locking mechanism that’s keeping my coworkers from connecting as I did? Or could it have something to do with our network being server-client? The message being generated is “The connection to the data source ‘Oo_to_MySQL’ could not be established. The specified driver could not be loaded!’ I’m having no problem but on one else is successful. Help!

What Do You Think?