5 replies
by ld Accepted solution
by Former member Accepted solution
I'm trying to figure out how I can use ODBC with MySQL so that database-driven Microsoft Office applications can work smoother (e.g., mail merge). I started by installing the latest production release of MySQL Connector/ODBC. I downloaded and executed the "Driver Installer" for Windows. I then followed along the FAQ "How do I configure Connector/ODBC DSN on Windows". I then opened up Microsoft Word, selected Tools -> Letters and Mailings -> Mail Merge Wizard. I selected Envelope. After selecting an Envelope size, use Browse to select the database. It works. Use "Connect to New Data Source" and then "ODBC DSN". Nice.
Here are more detailed instructions... starting from square one. Prerequisites are a net connection, a running MySQL server, and Microsoft Word.
1. Download and install the MySQL Connector/ODBC driver
2. With administrator priviledges, select Control Panel -> Adminstrative Tools -> Data Sources (ODBC)
3. Click on Add and select "MySQL ODBC 3.51 Driver"
4. Fill out the details on your MySQL server and then click OK
5. Now, fire up Microsoft Word and select Tools -> Letters and Mailings -> Mail Merge Wizard
6. Though aesthetically the correct choice is "Envelopes", the practical choice is "Labels", so choose "Labels" and click Next: Starting document
7. Click on Label options and select the correct template (for this example I chose 5160) and go on to the next step
8. Click Browse... to use an existing list. Use "Connect to New Data Source.odc"
9. Select "ODBC DSN"
10. You should see the data source created earlier, in my case, "ahcouk"
11. Now select the desired table, e.g., the invitation labels would be stored under "guests", seating name tags under "rsvp"
12. Finish up and you should see the contents of the selected table
13. The Mail Merge Recipients window is very powerful, allowing you to sort and filter the records as needed by simply clicking the headers and header buttons, I suggest, however, restraining yourself and using instead the (Advanced..) option available from down arrow buttons in the header. In the example below I selected for my mail merge A-list guests in the United States with the address_1 field filled and no outstanding inquiries
14. Fancy mail merging will be reserved for a different entry. Click on Next: Arrange your labels. The mail merge fields are available when you click More items...
15. A label template like
�invitation�
�address_1�
�address_2�{ IF {MERGEFIELD address_2}="" "" "?"}�city�, �state� �zip�
should prove useful. Don't just cut and paste, the curly brackets are inserted using Ctrl-F9, and the fields using the More items... menu. Some additional logic will be needed to cope with international addresses. You can find more information on using mail merge fields here:
http://word.mvps.org/FAQs/MailMerge/MMergeIfFields.htm
To replicate the first label, click on Update all labels.
More info here:
http://torque.oncloud8.com/archives/000160.html
Please post back if you have any more problems or questions.
If this information is useful, please mark as helpful. Thanks.
by temp1901 Accepted solution
When I tried to set my data source, the test came back with:
[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'lasplash.com' (10060)
The username and password for the account are setup with non-localhost access enabled.
Any suggestions?
by shasca Accepted solution
Can you do a query and save the results locally? If you can you could then do a merge from the saved data saved in either excel, or Access format.
Hopefully you have more that just word installed on your PC.
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending