Error ocurred when try to connect Access

P

pwml

Hi there,

I wrote an MFC app (VS 6.0) to try to open an Access database. The db is not
password protected and no ".mdw" file exists. I got an error ON and OFF:
"Cannot start your application. The workgroup information file is missing or
opened exclusively by another user." The thing is it doesn't happen all the
time.

Here is my connection string:
LPCTSTR lpszConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Access\MyWork.mdb;User ID=admin;Password=;"

m_pADOConnection->Mode = adModeShareDenyNone;
m_pADOConnection->CursorLocation = adUseClient;
m_pADOConnection->Open (_bstr_t (lpszConnection), _T(""), _T(""),
adConnectUnspecified);
m_pADOConnection->CommandTimeout = 0;
(m_pADOConnection is the pointer of _ConnectionPtr)

Thanks in advance for any help. - pwml
 
A

Arvin Meyer [MVP]

pwml said:
I wrote an MFC app (VS 6.0) to try to open an Access database. The db is
not
password protected and no ".mdw" file exists.

That's your problem right there. Access requires an MDW file to open. It is
the security file which has, at the very least an admin account with no
password. The file MUST exist.

If you are sure the database is unsecured, you can copy the system.mdw file
from another computer. Depending upon the version of Access, the file
normally resides in the same folder with msaccess.exe, or in later versions
in the Windows\System32\ directory.

If you still can't log in, try joining the workgroup for that system.mdw:

Tools >>> Security >>> Workgroup Administrator
 
P

pwml

Hi Arvin,

Thanks a lot for your replay.

I believe that if an Access file is just for a single user it doesn't need
an MDW file to open the file. In my case, it works in most of time, but
SOMETIMES it throws the error of "Cannot start your application. The
workgroup information file is missing or
opened exclusively by another use."

That is what I am really confused about.

pwml
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top