Calling MS Word Mail Merge with Database Password

J

John C

How do I call an MS Word Mail Merge document from VB.NET so it does not ask
the user for the MS Access Database Password? (not user password)

I am performing Word XP automation from a VB.NET program. The Word document
is set up to mail merge against an Access XP database. The Database has a
Database Password on it.

Without the database password, the document comes up just fine and without
any user interface intervention from MS Word.

I have tried a couple of commands that still popup the enter password dialog:

1.)
mWordDoc.MailMerge.OpenDataSource(
Name:="C:\Develop\TestMSWord\TestMSWord\bin\Docs\mydb.mdb",
LinkToSource:=True, PasswordDocument:="mypassword", SQLStatement:="TABLE
SellerInfo")

2)
mWordDoc.MailMerge.OpenDataSource( _
Name:="C:\Develop\TestMSWord\TestMSWord\bin\Docs\mydb.mdb", _
PasswordDocument:="mypassword", _
Connection:="Provider=Microsoft.Jet.OLEDB.4.0;Data Source & _
"C:\Develop\TestMSWord\TestMSWord\bin\Docs\mydb.mdb;" & _
"User Id=admin;Password=;Jet OLEDB:Database Password=mypassword;", _
SQLStatement:="Select * from `SellerInfo`")

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top