Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2017, 12:58 AM
travb81 travb81 is offline MySQL data source Windows 10 MySQL data source Office 2016
Novice
MySQL data source
 
Join Date: Aug 2017
Posts: 11
travb81 is on a distinguished road
Default MySQL data source

We have our data source as an Access 2016 database.

I have some VBA code to connect the mailmerge data, works great!
SQL statement looks like this:
Code:
"SELECT * FROM [qryJobsCollate] WHERE ([JobNumber]=" & strJobNumber & " AND qryJobsCollate.CStatusID<>5 AND qryJobsCollate.CStatusID<>7);"
Our backend database is now moving to a MySQL database, and I'm having all sorts of trouble maintaining MailMerge functionality.

I have an ODBC driver installed, and that works well for Excel to connect to MySQL and do what it needs to do.
But Word is not playing the game.



Some of the difficulties...
MySQL only has tables, no queries. So if Word is to include the query statement, it's going to include joins be >250 characters...

Code:
SELECT tblJobs.JobNumber, tblJobs.JobName, tblClients.CompanyName, tblPeople.FirstName, tblPeople.FullName, tblClients.Address1, tblClients.Address2C, tblPeople.Email, tblJobClientLink.CStatusID
FROM tblPeople INNER JOIN (tblJobs INNER JOIN (tblClients INNER JOIN tblJobClientLink ON tblClients.ID = tblJobClientLink.ClientID) ON tblJobs.JobID = tblJobClientLink.JobID) ON tblPeople.ID = tblJobClientLink.ContactID
WHERE (((tblJobClientLink.CStatusID)<>5 And (tblJobClientLink.CStatusID)<>7));
Has anyone has success with MySQL, obtaining data from joined tables?
I'm leaning towards writing some intermittent code that grabs the data out of MySQL, and puts it into another format (eg Excel spreadsheet) for Word to MailMerge from.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word & Excel 2010 - Best Options To Auto Insert MySQL & Excel Data? Hoser Word 1 03-17-2017 03:47 PM
Share my data on via MYSQL??? cwksr Excel 0 08-24-2014 03:23 AM
How to populate cells in Sheet2 with Data Source query using cell data from Sheet1 bobznkazoo Excel 2 03-27-2014 11:14 AM
MySQL data source Mail Merge / DSN / Data Link / MySQL Bob Young Mail Merge 5 05-18-2012 03:44 PM
Edit Data Source- Linking template charts to new data lbf PowerPoint 0 10-28-2011 12:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft