Home | Community | Message Board

Please support our sponsors.

General Interest >> Science and Technology

Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Jump to first unread post. Pages: 1
blasted chipmunk
 User Gallery

Registered: 09/18/03
Posts: 8,057
hooking openoffice to mysql
    #4435018 - 07/21/05 08:39 PM (12 years, 8 months ago)


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.

Click here!

* 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.

OpenOffice.org is now connected to the MySQL database using the new Base application. You can look at the records in your database by clicking on the Tables icon (under the Database pane) and then the table name (under the Tables pane). Your data will appear as a table that you can navigate with the mouse or arrow keys.

Putting MySQL data to use in Writer or Calc

Once you've built a connection to your database, Writer and Calc will know about the connection whenever you start them up. Pulling data from your database and using it in a Writer document is easy.

* Select New, then Text Document. The following procedures work almost exactly the same way for Calc.
* Select Data Sources under the View tab.
* Click on the database that you set up in Base. Click the little "+" box to the left of the Tables icon, to show which tables are available. Click on the table name to make the records appear.
* To copy a field, click and hold the record field and drag it into your document. Release the mouse button to paste.
* You can also click the box at the upper left corner of the table (just to the left of names) to highlight all the fields, then click the "data to text" button (text with little right arrow to the right of the funnel-shaped icons). The resulting window will let you drag fields down as a table, fields, or text.
* Click the Text radio button, then select and arrange the fields however you like.
* Click OK and the contents of each record will be copied into the document. This is a great way to make a list of addresses. You can use this technique with other types of data to make basic text-oriented reports.

If you want to copy only a row of data, highlight the the box to the left of the first field and click the "data to text" button. All the data in the row will be copied into your Writer or Calc document.

If you'd like your data to show up as a table in your document instead of as formatted text lists, use the Table radio button under the "data to text" button.

If this introduction whets your appetite for integrating database information into your documents, you'll be happy to hear that OpenOffice.org provides more wizards to create queries, forms, and reports.

Connecting a MySQL database to OpenOffice.org is easy, especially by using the JDBC (Java) driver. However, with version, I was unable to design queries or forms from within Writer or Calc. My workaround was to set up those items using Base. I could then switch to and from my Writer document using the Window tab on the main OOo toolbar. That glitch aside, the connectivity worked without a hitch. You can use it effectively even if you aren't a super-techie.

No, no, you're not thinking, you're just being logical. ~ Niels Bohr

Post Extras: Print Post  Remind Me! Notify Moderator
Carpal Tunnel
 User Gallery

Registered: 04/11/99
Posts: 11,393
Loc: Canada
Last seen: 2 months, 6 days
Re: hooking openoffice to mysql [Re: automan]
    #4435177 - 07/21/05 09:18 PM (12 years, 8 months ago)

Neat! I've just been learning various mysql stuff for other purposes, I didn't know it could do that as well.

"I have no valid complaint against hustlers. No rational bitch. But the act of selling is repulsive to me. I harbor a secret urge to whack a salesman in the face, crack his teeth and put red bumps around his eyes." -Hunter S Thompson

Post Extras: Print Post  Remind Me! Notify Moderator
blasted chipmunk
 User Gallery

Registered: 09/18/03
Posts: 8,057
Re: hooking openoffice to mysql [Re: Phluck]
    #4438610 - 07/22/05 04:54 PM (12 years, 8 months ago)

yeah, i just downloaded the beta version of openoffice2.0 to see what i can get it to do with mysql.

No, no, you're not thinking, you're just being logical. ~ Niels Bohr

Post Extras: Print Post  Remind Me! Notify Moderator
Jump to top. Pages: 1

General Interest >> Science and Technology

Similar ThreadsPosterViewsRepliesLast post
( 1 2 all )
elbisivni 1,584 20 09/04/07 08:04 PM
by elbisivni
* PHP/MySQL help daytripper05 999 7 04/21/08 12:48 AM
by ectolysergic
* mysql help automanM 527 4 11/20/07 07:56 PM
by automan
* PHP/MySQL question daytripper05 788 7 04/28/08 06:43 PM
by daytripper05
* MySQL Q elbisivni 469 4 12/24/07 02:05 PM
by Sillicybin
* PHP, MySQL Programmer (job offer in craigslist chicago!) ZippoZM 471 0 07/11/06 04:20 PM
by ZippoZ
* my documents djblackout 449 4 06/29/08 09:10 AM
by djblackout
* mysql hint please sherm 686 10 07/01/05 09:25 PM
by automan

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Lana, trendal, automan
639 topic views. 0 members, 1 guests and 0 web crawlers are browsing this forum.
[ Toggle Favorite | Print Topic | Stats ]
Search this thread:
Shroom Supply
Please support our sponsors.

Copyright 1997-2018 Mind Media. Some rights reserved.

Generated in 0.03 seconds spending 0.007 seconds on 19 queries.