No subject


Wed Dec 28 11:38:03 CST 2011


  1. Set objWord = "JA45.dot"    ' an existing Word template on disk
  2. objWord.Application.Visible = true
  3. With objWord.MailMerge
     .MainDocumentType = wdFormLetters
     .OpenDataSource _
          Name:="this MDB name", _
          LinkToSource:=True, _
          Connection:="QUERY qry name in the MDB"
     .Execute
  4. End With

This worked great until ... the customer wanted some security features.  To the same MDW as I used to create the MDB, I added a couple of Groups and their Users, and in the basAutoExec code closed out immediately if the user was 'admin' (user trying to use a vanilla MDW).  Each user must now log in with a username and password.

In this new environment, when line 3 above executes, another copy of the MDB opens and attempts to login, and gets thrown out, and the DDE connection fails.  That is, except when I log in as me with my username/password (I'm the owner of the MDB and all components of), then it works fine.  I don't have much hair to pull out, and the various combinations of Permissions I tried to get this to work with the other users has got me at the wall.

Because the thing needed to be up and running yesterday, I have got around this problem by creating a MailMerge .txt file external to the MDB and pointing the Word templates to this .txt file.  Line 3 above has become:
   With objWord.MailMerge
     .MainDocumentType = wdFormLetters
     .OpenDataSource Name:="the .txt file on disk"
     .Execute
and this works.

I am still interested in what is going on.  My suspicion is that it has something to do with the Word templates not opening the MDB with the same username/password used to get in to the original MDB.  But if I am right, how do you do that?

MTIA.

Stephen Bond 
Otatara, South Island, New Zealand 



More information about the AccessD mailing list