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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to ODBC Datasource

Status
Not open for further replies.

da644

Programmer
May 21, 2001
159
GB
Hi.

I have an ODBC Datasource setup (it is a MySQL database behind it) and I would like to write a Macro in Word to go through this database open a document, defined in the database, change the document properties title, save the document, close the file and move onto the next one. I have a good idea of how to do all of this apart from I connect get a connect to the database. Could someone point me in the right direction or a URL to an example of how to connect to an ODBC datasource from Word VBA as nothing I have found so far actually works.

Thanks in advanced.

Best Regards

Andrew.
 
In your VBE references choose either Microsoft DAO or Microsoft ActiveX Data Objects and then take a look at the Recordset object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Not really, can you give me some example code? I did find some example code for DAO, but it didn't work. Please help.
 
There are plenty of working examples on these foruns/faq's. search them, and then post the code you have tried, along with any errors you are getting.



Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top