Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    2

    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.

  2. #2
    Join Date
    Oct 2002
    Location
    france
    Posts
    6

    perhaps...

    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;")

    Galldup

  3. #3
    Join Date
    May 2003
    Posts
    2

    Re: perhaps...

    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;")

    Galldup
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •