Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    Columbus, OH
    Posts
    36

    Question Unanswered: Specifying the default MDW Access 2000

    What would be the code in VBA to specify the default security MDW file for an Access 2000 database? Access 2003 has the SetDefaultWorkgroupFile property. I can't find the equivalent.

    Dim mySource As Access.Application
    mySource.SetDefaultWorkgroupFile ("C:\myfile.mdw")

    Thanks in advance.

  2. #2
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    I'm not sure about the code. Do you already know how to open a database with a shortcut and link to the MDW file using the /wrkgrp option?

    Why do you want to refer to the MDW file programmatically?

  3. #3
    Join Date
    Feb 2004
    Location
    Columbus, OH
    Posts
    36

    Open Database Programatically with MDW

    I need to be able to open the database programatically so I can reference it in code. If I open it just using C:\myDatabase.mdb /wrkgrp option I can't reference it in VBA then.

    Will the database will default to system.mdw if nothing is specified?

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Quote Originally Posted by gfinzer
    Will the database will default to system.mdw if nothing is specified?
    I would imagine so. It has to use something.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Well gfinzer, I'm not sure. The following is just a guess.

    Dim mySource As Access.Application
    Set mySource = New Access.Application
    mySource.DBEngine.DefaultUser = "UserName"
    mySource.DBEngine.DefaultPassword = "UserPassword"
    mySource.SetDefaultWorkgroupFile "C:\myfile.mdw"
    mySource.OpenCurrentDatabase "test.mdb", False, ""

  6. #6
    Join Date
    Feb 2004
    Location
    Columbus, OH
    Posts
    36
    @jpshay,

    Yeah, that code works for Access 2003 but the SetDefaultWorkgroupFile is not a property in Access 2000.

    Greg

  7. #7
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Does a connection provide sufficient access to the database?
    If so, perhaps this type of a connection string will help.

    MyConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Password=MyPass; User ID=MyUser;Data Source=C:\My.mdb;Persist Security Info=True;Jet OLEDB: System database=C:\MyPath\MySecurity.MDW;Jet OLEDB: Database Password=MyDBPass"

    mySource.open MyConnect

    I added some spaces to get rid of silly smile icons.
    Last edited by jpshay; 03-04-08 at 11:22.

Posting Permissions

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