Home | Community | Message Board


Shroom Supply
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
InvisibleautomanM
blasted chipmunk
 User Gallery

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

http://software.newsforge.com/software/05/07/12/1544207.shtml

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 1.9.79.2.3, 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
OfflinePhluck
Carpal Tunnel
 User Gallery

Registered: 04/11/99
Posts: 11,393
Loc: Canada
Last seen: 4 months, 26 days
Re: hooking openoffice to mysql [Re: automan]
    #4435177 - 07/21/05 09:18 PM (12 years, 3 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
http://phluck.is-after.us


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

Registered: 09/18/03
Posts: 8,042
Re: hooking openoffice to mysql [Re: Phluck]
    #4438610 - 07/22/05 04:54 PM (12 years, 3 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
* ATTN: PHP/MySQL Gurus
( 1 2 all )
elbisivni 1,525 20 09/04/07 08:04 PM
by elbisivni
* PHP/MySQL help daytripper05 979 7 04/21/08 12:48 AM
by ectolysergic
* mysql help automanM 511 4 11/20/07 07:56 PM
by automan
* PHP/MySQL question daytripper05 771 7 04/28/08 06:43 PM
by daytripper05
* MySQL Q elbisivni 467 4 12/24/07 02:05 PM
by Sillicybin
* PHP, MySQL Programmer (job offer in craigslist chicago!) ZippoZM 460 0 07/11/06 04:20 PM
by ZippoZ
* mysql hint please sherm 666 10 07/01/05 09:25 PM
by automan
* php & mysql Cepheus 707 8 01/22/07 03:36 PM
by Cepheus

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

Copyright 1997-2017 Mind Media. Some rights reserved.

Generated in 0.025 seconds spending 0.004 seconds on 19 queries.