Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
Database Connect String
I am trying to use the following code for a mail merge -- please advise:
with oDoc.MailMerge .OpenDataSource "",,,,,,,,,,,"PROVIDER=Microsoft.Jet.OLEDB.4.0;Dat a Source=c:\abc2.mdb","select * from contacts" ..Execute The key is that I need to be able to connect to database without using ODBC. Thanks, Steve T |
#2
|
|||
|
|||
Hi ?B?U3RldmVUcnVl?=,
I am trying to use the following code for a mail merge -- please advise: with oDoc.MailMerge .OpenDataSource "",,,,,,,,,,,"PROVIDER=Microsoft.Jet.OLEDB.4.0;Dat a Source=c:\abc2.mdb","select * from contacts" ..Execute The key is that I need to be able to connect to database without using ODBC. Which version of Word? I take it you want to connect to an Access database? Have you tried recording making the connection in a macro and using that code? If you haven't, do so; if you have and it doesn't work, please describe exactly how it's not working. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#3
|
|||
|
|||
This is VBScript embedded in an ASP page.
I want to do the mail merge based on user input from the ASP page. The database has to be assigned on the fly -- thus the requirement to use a connect string at runtime -- I would like to use OLE DB to make the connection to either an Access or MS SQL Server. When I use the connection string from the code snippet in my first post, I get a dialog that says: Confirm Data Source - and presents a list of datasource types. When I choose OLE DB, the Word doc opens, but the ASP page gets the following error message: Word was unable to open the data source. It is very close to working, I just need help with the connect string to Access or SQL Server using OLE DB. Thanks again. Steve T. "Cindy M -WordMVP-" wrote: Hi ?B?U3RldmVUcnVl?=, I am trying to use the following code for a mail merge -- please advise: with oDoc.MailMerge .OpenDataSource "",,,,,,,,,,,"PROVIDER=Microsoft.Jet.OLEDB.4.0;Dat a Source=c:\abc2.mdb","select * from contacts" ..Execute The key is that I need to be able to connect to database without using ODBC. Which version of Word? I take it you want to connect to an Access database? Have you tried recording making the connection in a macro and using that code? If you haven't, do so; if you have and it doesn't work, please describe exactly how it's not working. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#4
|
|||
|
|||
Hi ?B?U3RldmVUcnVl?=,
When I use the connection string from the code snippet in my first post, I get a dialog that says: Confirm Data Source - and presents a list of datasource types. When I choose OLE DB, the Word doc opens, but the ASP page gets the following error message: Word was unable to open the data source. Yes, and did you try what I suggested: recording making the connection in a macro? Often, that will give you exactly the little piece in the puzzle that you're missing... FWIW, an OLE DB connection to Access is not optimal; there are issues with OLE DB connections that use the JET driver. But you should be OK if this is a one-off, throw away and your users have a US-EN setup, or won't be using the original Word 2002 release. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I'm having trouble merging Word document with MS Works database. | Mailmerge | |||
How do I renumber a database (w/hidden rows) to make it sequencial | Mailmerge | |||
How to remove Database link in Merged to New Document | Mailmerge | |||
Mail Merge - DataPerfect database to Word | Mailmerge | |||
Mailing List from an Access Database | Mailmerge |