PDA

View Full Version : [SOLVED:] Workgroup information file is missing...



Ken Puls
02-06-2006, 09:42 PM
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:


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:


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

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!

matthewspatrick
02-06-2006, 09:49 PM
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 :whip

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

Ken Puls
02-06-2006, 09:55 PM
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
02-06-2006, 10:03 PM
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
02-06-2006, 10:10 PM
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?

matthewspatrick
02-06-2006, 10:13 PM
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

Ken Puls
02-06-2006, 10:37 PM
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:


Set cnt = CreateObject("ADODB.Connection")
cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sDbPath & ";" & _
"Jet OLEDB:Database Password=" & sPword & ";"

:)