Consulting

Results 1 to 7 of 7

Thread: Solved: Workgroup information file is missing...

  1. #1
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location

    Solved: Workgroup information file is missing...

    Hi guys,

    I'm having a bit of an issue with something, and I don't know where to go with it. I'm trying to connect to an access database via ADO, and every time I try and connect to it, I keep getting the following error:

    Quote Originally Posted by Stupid Message Box
    Run-time error '-2147217843 (80040e4d)':

    Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
    By searching on the net, I think I've figured out that it is looking for a system.mdw file. The person has emailed me all the files form the directory, though, and there is no system.mdw file in there, although there are a bunch of API files, if that's important.

    What's weird is that I can open the database file manually, I just have to enter the password (and yes, I am providing it via code), and I've been able to do that since I only had the db file and not the entire directory.

    The line of code that gets stuck is this one:

    [vba]cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sdbpath & strdb & ";Password=thepassword;"[/vba]

    I have made this work for a database of my own creation, but I do know that this particular database is launched via an .exe file (not made by me.)

    Anyone have any idea of how I can get at it via code? Will DAO get me there? And if so, how the heck do I set up a connection that uses a password. The help files have proven useless to me so far.

    Thanks!
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  2. #2
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    Yet another reason why I try to talk people out of using Access "security". I always tell people, if you need security, go to SQL Server

    If you are not specifying a workgroup file (yes, it is MDW) in a command-line opening, then Access will use the default MDW on your computer; the path to it is defined in the Registry. When you open the MDB manually, you appear to be linking to that default MDW. When you try to go with ADO, apparently, ADO does not know how to handle it.

    Sorry I could not add more useful stuff--I am still an amateur when it comes to configuring Access security. But I do know enough about it that I will only agree to use it under duress.

    Patrick

  3. #3
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Are you kidding, Patrick? That's HUGELY helpful!

    Can you tell me... what version of office are you running, and would it be the same for all installations? Mine (Office 2003) is in "C:\Program Files\Microsoft Office\OFFICE11\1033\system.mdw"

    Is yours the same?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  4. #4
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Ah, actually it's not that one. It's the user specific one instead:

    C:\Documents and Settings\kpuls\Application Data\Microsoft\Access\system.mdw

    Different error message, but getting closer (hopefully)...
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  5. #5
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Okay, now that I've linked to the one above, it's telling me that I have an invalid password. I'm giving the db password, and using "admin" as the user.... any ideas?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  6. #6
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    Ken,

    I am running Office 2002. There is a System.MDW, but it's under C:\Documents and Settings\myuserid\Application Data\Microsoft\Access

    That may or may not be the default location. I never actually use it. The only secured Access db is one that I use a special MDW filw for (for a client who insisted they had to have security, no matter how hard I tried to talk them out of it); I always launch that file with a shortcut configured with the proper command-line stuff to specify a workgroup file.

    Sorry, now I'm about at the end of my rope...

    Good luck,

    Patrick

  7. #7
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Got it!

    I was getting hung up on trying to link to that system.mdw file. A search on my password issue turned up some fruit though.

    The actual connection string for an ADO connection does not need to reference the System file at all if it just has a database password on it:

    [vba]Set cnt = CreateObject("ADODB.Connection")
    cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & sDbPath & ";" & _
    "Jet OLEDBatabase Password=" & sPword & ";"[/vba]

    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





Posting Permissions

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