Unanswered: How to enter the OpenDataSource Name argument for a secured database
I'm a beginner. I found a user function called "MergeIt()" that I modified to work perfectly to handle a Word Mail merge. It uses the OpenDataSource method to connect to my database. But once I added user-level security, I have not been able to figure out how to enter the new path in the Name argument. The path must include the /WRKGRP switch which I think poses the problem because the argument needs to be a string. However this won't work (except in the shortcut the User Level Security Wizard creates):
"\\Fs01\BCIShare\Access Contacts\Dealer and Bank Contacts.mdb" /WRKGRP "\\Fs01\BCIShare\Access Contacts\Secured.mdw"
I have tried moving the quotes around with no success. Any suggestions would be appreciated.
Originally posted by galldup
I use this code for opening a secured database...
Set dbs_TMP = DBEngine.OPENDATABASE("\\Pcwsv01\ASPA_All\TMP\ASPA TMP.mdb", False, False, ";PWD=MotDePasse;")
Thanks for the reply! That method would seem to work for a database secured by a password, but user level security requires the /WRKGRP switch with a reference to the path of the workgroup information file -- secured.mdw in my case, as in the example I used. The dbname argument of the opendatabase method in your example is a string just as the name argument of the opendatasource method I'm using. My problem is I can't figure out how to enter the string with the /WRKGRP switch that access will accept. I guess the ultimate question is, how do you connect to a database with user level security using VBA? Any ideas on that?