Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2005

Tip: Looking for answers? Try searching our database.

Database Connect String

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SteveTrue - 23 Mar 2005 17:55 GMT
I am trying to use the following code for a mail merge -- please advise:

with oDoc.MailMerge
   .OpenDataSource "",,,,,,,,,,,"PROVIDER=Microsoft.Jet.OLEDB.4.0;Data  
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
Cindy M  -WordMVP- - 24 Mar 2005 12:05 GMT
Hi =?Utf-8?B?U3RldmVUcnVl?=,

> I am trying to use the following code for a mail merge -- please advise:
>  
[quoted text clipped - 4 lines]
>  
> 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 :-)
SteveTrue - 24 Mar 2005 16:15 GMT
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.

> Hi =?Utf-8?B?U3RldmVUcnVl?=,
>
[quoted text clipped - 19 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Cindy M  -WordMVP- - 26 Mar 2005 12:20 GMT
Hi =?Utf-8?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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.