OLEDB Question

S

SSweez

I have a problem that I just can not seem to get anywhere with. I have

an exel file that I am connecting to a password protected Acess
database (both on a network drive). I am using OLEDB. The following
is my connection string that works if the database is not protected.

sConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & DBPath


When it is protected I get an error that my reserach seems to indicate
that I need a path to an .mdw file. I do not know much about what this

file is and how to get the address for it. I thought about using ODBC.

Is this the best option and if so can someone give me a example of an
ODBC connection string? Or how I can find the path to the .mdw file?
Will this be a problem if various people will be using the file?
Thanks an advance.
 
G

Geoff

If the Access database needs the user to log in with only a *password*, then
the database is not using a special "mdw" file to allow access to the
database. In contrast, if the database needs the user to login with a *user
name and password*, then the database is using a special "mdw" file to allow
access to the database.

Files with the "mdw" filename extension are Workgroup Information files (aka
System files). When a database requires a special "mdw" file, the database
developer has implemented user-level security to protect the database. The
Workgroup Information (mdw) file stores information about the users who are
allowed to use the database and their passwords. The database itself would
contain information about what rights to the database those users had; for
example, whether a user had rights to open a form.

An Access database that does not require users to login with a user-name and
password still uses user-level security but everyone is logged in as the
Admin user with full rights to the database. In this case, Access is using
a Workgroup Information file named "system.mdw" that ships with Access.

It sounds as though you are only using a password to protect the whole
database, ie that you are not using user-level security. If that's the
case, then it would appear that the error message you are getting is
misleading when it says you need to specify an "mdw" file. Here follows the
full format for a OLE DB connection string for an Access database, which
should allow you to find the parts you need to specify:

Provider=Microsoft.Jet.OLEDB.4.0;
User ID=Admin;
Data Source=C:\MyDatabase.mdb;
Mode=Share Deny None;
Extended Properties="";
Locale Identifier=1033;
Persist Security Info=False;
Jet OLEDB:System Database=C:\SYSTEM.MDW;
Jet OLEDB:Registry Path="";
Jet OLEDB:Database Password="";
Jet OLEDB:Engine Type=5;
Jet OLEDB:Database Locking Mode=1;
Jet OLEDB:Global Partial Bulk Ops=2;
Jet OLEDB:Global Bulk Transactions=1;
Jet OLEDB:New Database Password="";
Jet OLEDB:Create System Database=False;
Jet OLEDB:Encrypt Database = False;
Jet OLEDB:Don't Copy Locale on Compact=False;
Jet OLEDB:Compact Without Replica Repair=False;
Jet OLEDB:SFP=False

The above lines show (1) the Provider (first line), (2) the standard ADO
connection properties (User ID to Persist), and (3) provider-specific
connection properties (all lines beginning with Jet OLEDB).

Geoff.
 

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