Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL and MicroSoft Word

Status
Not open for further replies.

moppsy

IS-IT--Management
Dec 22, 2004
22
US
We are trying to allow someone to use MicroSoft Word on their computer to update the MySQL databasse on a remote server. Nothing is working. Any idea what we need to do to accomplish this. Thanks for your help in advance.
 
microsoft word doesn't have an interface for remote mysql updates

i don't think there's anything you can do about it, sorry

r937.com | rudy.ca
 
I haven't heard of using a word processor to update a database. If it can be done at all, it's probably through ODBC so you could start looking there. That's how Excel and Access would connect to MySQL.
 
You can use OpenOffice.org (including its Writer module, similar to MS Word) to communicate with MySQL via ODBC/JDBC, running SQL queries and importing data.
 
Thanks Tony. We believe using an ODBC/JDBC connector is the answer but we don't know how to use it. Can you give us some sample code or scripts. We could not find any answers on the internet. Thanks
 
To set up a MYSQL ODBC connection in Windows, you first need to install the MySQL ODBC Connector, available free from the MySQL site. Then you use the appropriate Control Panel applet to set up the connection. It's called something like "Data Sources (ODBC)".

In that dialogue, you need to set up a System DSN using the MySQL driver, giving it a name of your choice, and specifying the server hostname/address, username/password, and default database to be used. Then you can test the connection before finishing.
 
Control Panel > Administrative Tools > Data Sources (ODBC)

had to look it up (it was nice to be able to find it again now, as opposed to when my one single odbc connection stops working)

r937.com | rudy.ca
 
Word and OO Writer (and others) can use ODBC to import SQL data, such as for a mail merge. I still think you're barking up the wrong tree for updating the database, though.
 
Tony we have the ODBC installed we need the code to update MySQL from MicroSoft Word. That's the problem.
 
It depends what you mean by "updating from MS Word". I haven't used MS Office for a few years so I don't know what it offers. I do know that in any OpenOffice module, you can open a "data sources" window, select a data source, "open" a table, and edit it in-place by copying data from the open document, or running SQL update queries. As to whether MS Word offers anything equivalent, I would accept the opinions of the other posters who seem to suggest that it hasn't. There may also be the possibility of writing macros to do the job, but that's a subject for a different forum.
 
Although it may be just barely possible to give Word the ability to update MySQL records, doing so would require massively complicated VBA code.

It is simply a fact that trying to use Word for updating a database is like trying to use a screwdriver to drive a nail -- it can be done, but it is strongly counter-recommended, as there are vastly superior tools for the purpose.

If you have to use a Microsoft product to update these records, Access is the appropriate tool. Whereas Word will require hundreds if not thousands of lines of VBA code to do what you want, Access can do it easily with little if any coding.

If you goal is simply to update the records, there are many free products out there that can allow you to do this, published by several groups.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Thanks everyone. Can you point us in the direction to get the complicated VBA code because it is highly desirable to use Word for our end users. However, our backend has been MySQL for 20 plus years. We cannot change it at this point.
 
That code (if it's even possible to do what you want) will be sufficiently complicated that you will nearly certainly need to hire a VBA programmer to write it for you. It's unlikely you'll find such a beast prewritten anywhere -- at least, I've never heard of it.

Again, I strongly recommend your using another product to maintain your database updates.



Want the best answers? Ask the best questions! TANSTAAFL!
 
However, our backend has been MySQL for 20 plus years.
are you certain that you are using MySQL? maybe using Microsoft SQL Server? i'm having a really really hard time believing that MySQL has been around since 1986

r937.com | rudy.ca
 
The 20 years was just synomous to mean forever. We've actually been using MySQL for about 8 years.
 
okay, you've been running mysql for 8 years, without needing to update it via Word in all that time, and you suddenly want to start now?

also, you mentioned in your first post that "someone" wanted to do this -- i think you should go back to that person and tell them they can only update the remote database with a product that can actually do it, like, say, the mysql query browser


r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top