opendatasource - avoid password prompt

  • Thread starter darren via OfficeKB.com
  • Start date
D

darren via OfficeKB.com

Hi

Pulling my hair out. I have an ACC2003 mde which has basic password
protection (not mdw). It opens a merge document (Word2003) and sets
datasource using opendatasource. However, it prompts the users for a password.
I have tried to include the password but the prompt still appears. All help
appreciated.

strConnection = "DSN=MS Access Database;DBQ=" & CurrentProject.FullName & "
;FIL=MS Access'UID=Admin;PWD=test;"

' Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:=CurrentProject.FullName, _
LinkToSource:=True, _
Connection:=strConnection, _
ReadOnly:=True, _
SQLStatement:="SELECT * FROM [" & strTbl & "]"

Thanks

Darren
 
D

darren via OfficeKB.com

Think I've sussed it. I tried setting it manually then looking at
connectstring but still did not work. However, when I tried doing exactly the
same thing but recording it as a macro I got a different result.

Solution:

Name:="", _
 

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