Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Don » Thu, 06 Sep 2001 01:27:02



I am trying to "secure" an .mdb file that is being accessed by several users
from a VB client using ADO access.  The .mdb file is on a network drive.
The best I can gather from the documentation, if the userID and password are
provided, ADO tries to use the default workgroup file on the local machine.

  db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=n:\Board\Board.mdb;UserID=RemoteAccess;Password=xyZ"

Am I way off base here?  How can I password protect the .mdb file (more to
keep people from meddling with it than data security reasons) so that the VB
clients on the local machines can open the file?  Basically, I want to
prevent a casual user from using Access to open the .mdb file on the network
drive.

Any pointers to references or ideas for a solution will be greatly
appreciated!!!

Thanks!!

Don

 
 
 

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Eric Garz » Thu, 06 Sep 2001 02:20:43


Please take a look at Carl Prothman's (MVP) FAQ
http://www.able-consulting.com/ADO_Conn.htm

Please don't crosspost.

Regards,
Eric Garza, MVP


Quote:

> I am trying to "secure" an .mdb file that is being accessed by several
users
> from a VB client using ADO access.  The .mdb file is on a network drive.
> The best I can gather from the documentation, if the userID and password
are
> provided, ADO tries to use the default workgroup file on the local
machine.

>   db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
> Source=n:\Board\Board.mdb;UserID=RemoteAccess;Password=xyZ"

> Am I way off base here?  How can I password protect the .mdb file (more to
> keep people from meddling with it than data security reasons) so that the
VB
> clients on the local machines can open the file?  Basically, I want to
> prevent a casual user from using Access to open the .mdb file on the
network
> drive.

> Any pointers to references or ideas for a solution will be greatly
> appreciated!!!

> Thanks!!

> Don


 
 
 

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Don » Thu, 06 Sep 2001 10:36:14


Well, I looked at Carl's page, but based on his examples it looks like you
can't specify a workgroup file or database password using the ADO
nterface  -- I think.  (Hence the cross post; I don't know if this is doable
in ADO or if I should be using odbc.)

One of the links on Carl's page lead me to:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado2...
mdrefjetprovspec.asp

which has the following reference (abbreviated):

Provider-Specific Connection Parameters
The OLE DB Provider for Microsoft Jet supports several provider-specific
dynamic properties in addition to those defined by ADO. As with all other
Connection parameters, they can be set via the Connection object's
Properties collection or as part of the connection string.

The following table lists these properties with the corresponding OLE DB
property name in parentheses.

Jet OLEDB:Database Password
(DBPROP_JETOLEDB_DATABASEPASSWORD)
        Indicates the database password.

Jet OLEDB:System Database
(DBPROP_JETOLEDB_SYSDBPATH)
    Indicates the path and file name for the workgroup information file
(system database).

This implies to me that I should be able to add "Database Password =" to the
ConnectionString like so:

db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=n:\Board\Board.mdb;Database Password=xyZ"

(The database is simply password protected.)

However, when I made the change I got the following error:

    Runtime Error "-2147467259 (80004005)":
    Could not find installable ISAM.

When I clicked 'Help' I got information on "Form Window".

Summarizing:

1)  Is it possible to open a password protected database using ADO?

2)  If so how?

3)  If not, what is considered the common approach for doing this.

Thanks!!

Don


> Please take a look at Carl Prothman's (MVP) FAQ
> http://www.able-consulting.com/ADO_Conn.htm

> Please don't crosspost.

> Regards,
> Eric Garza, MVP



> > I am trying to "secure" an .mdb file that is being accessed by several
> users
> > from a VB client using ADO access.  The .mdb file is on a network drive.
> > The best I can gather from the documentation, if the userID and password
> are
> > provided, ADO tries to use the default workgroup file on the local
> machine.

> >   db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
> > Source=n:\Board\Board.mdb;UserID=RemoteAccess;Password=xyZ"

> > Am I way off base here?  How can I password protect the .mdb file (more
to
> > keep people from meddling with it than data security reasons) so that
the
> VB
> > clients on the local machines can open the file?  Basically, I want to
> > prevent a casual user from using Access to open the .mdb file on the
> network
> > drive.

> > Any pointers to references or ideas for a solution will be greatly
> > appreciated!!!

> > Thanks!!

> > Don

 
 
 

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Carl Prothma » Thu, 06 Sep 2001 14:39:21



> Well, I looked at Carl's page, but based on his examples it looks like you
> can't specify a workgroup file or database password using the ADO
> nterface  -- I think.  (Hence the cross post; I don't know if this is doable
> in ADO or if I should be using odbc.)

Don,
Yes you can specify a Workgroup or a Database Password using the JET OLE DB Provider
http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForMicrosoftJet
- see both examples

<snip>

Quote:> This implies to me that I should be able to add "Database Password =" to the
> ConnectionString like so:
> db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
> Source=n:\Board\Board.mdb;Database Password=xyZ"
> (The database is simply password protected.)
> However, when I made the change I got the following error:
>     Runtime Error "-2147467259 (80004005)":
>     Could not find installable ISAM.

You must put "Jet OLEDB:" in front of the "Database Password".

e.g.
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                   "Data Source=c:\somepath\mydb.mdb;" & _
                   "Jet OLEDB:Database Password=MyDbPassword;", _
                   "admin", ""

Quote:

> Summarizing:

> 1)  Is it possible to open a password protected database using ADO?

    Yes

Quote:> 2)  If so how?

    See above example

Quote:> 3)  If not, what is considered the common approach for doing this.

Note that an Access database password can be broken into very easy.  
Recommend you take a look at MSDE 2000
http://www.microsoft.com/SQL/techinfo/development/2000/MSDE2000.asp

--

Thanks,
Carl Prothman
Microsoft Visual Basic MVP
http://www.able-consulting.com

 
 
 

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Don » Thu, 06 Sep 2001 23:00:16


Carl,

I think I see now!  Just overwhelmed by all the options I suppose!

Is there a good reference text on ADO and how ODBC, OLEDB, etc relate to it?
As you have undoubtedly concluded, I am now in that very dangerous stage of
the learning process where I know enough of the keywords and am biased by
past experience that is not necessarily related to the problem.

I realize that simple database password protection is easily broken
(actually had to do it to one of my own files once!  :-)  ).  The only
reason I want to add the password is to make it a _little_ harder for
someone to inadvertently open the database file.  I had a user inadvertently
open the file while people were connected using the VB app (a crude system
status indicator -- not very robust but helps since we are in two separate
buildings).  Needless to say, it quickly hosed things up!!

Your web page has been duly bookmarked and notes put in my notebook.

Thanks to you, and Eric!!

Don

Quote:

> Don,
> Yes you can specify a Workgroup or a Database Password using the JET OLE
DB Provider
> http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForMicrosoftJet
> - see both examples

> <snip>

> Note that an Access database password can be broken into very easy.
> Recommend you take a look at MSDE 2000
> http://www.microsoft.com/SQL/techinfo/development/2000/MSDE2000.asp

> --

> Thanks,
> Carl Prothman
> Microsoft Visual Basic MVP
> http://www.able-consulting.com

 
 
 

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Carl Prothma » Fri, 07 Sep 2001 00:21:40



Quote:> I think I see now!  Just overwhelmed by all the options I suppose!

Don,
Agreed!  There are a lot of "hidden" JET properties!

Quote:> Is there a good reference text on ADO and how ODBC, OLEDB, etc relate to it?

I've compiled a list of ADO books at
http://www.able-consulting.com/books_ado.htm

Quote:> As you have undoubtedly concluded, I am now in that very dangerous stage of
> the learning process where I know enough of the keywords and am biased by
> past experience that is not necessarily related to the problem.

We've all been there at some point in our careers!   ;-)

Quote:> I realize that simple database password protection is easily broken
> (actually had to do it to one of my own files once!  :-)  ).  The only
> reason I want to add the password is to make it a _little_ harder for
> someone to inadvertently open the database file.  

OK, I understand.

Quote:> I had a user inadvertently
> open the file while people were connected using the VB app (a crude system
> status indicator -- not very robust but helps since we are in two separate
> buildings).  Needless to say, it quickly hosed things up!!

Stuff happens...  

Quote:> Your web page has been duly bookmarked and notes put in my notebook.

Thanks for the feedback.  I'm glad my ADO connection page was helpful to you.   ;-)

--

Thanks,
Carl Prothman
Microsoft Visual Basic MVP
http://www.able-consulting.com

 
 
 

Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

Post by Paul VERSCHEUR » Fri, 07 Sep 2001 17:47:06


Helpful  for me too. Thanks Carl

Regards

Paul



Quote:

> Thanks for the feedback.  I'm glad my ADO connection page was helpful to
you.   ;-)

> --

> Thanks,
> Carl Prothman
> Microsoft Visual Basic MVP
> http://www.able-consulting.com

 
 
 

1. Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

I am trying to "secure" an .mdb file that is being accessed by several users
from a VB client using ADO access.  The .mdb file is on a network drive.
The best I can gather from the documentation, if the userID and password are
provided, ADO tries to use the default workgroup file on the local machine.

  db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=n:\Board\Board.mdb;UserID=RemoteAccess;Password=xyZ"

Am I way off base here?  How can I password protect the .mdb file (more to
keep people from meddling with it than data security reasons) so that the VB
clients on the local machines can open the file?  Basically, I want to
prevent a casual user from using Access to open the .mdb file on the network
drive.

Any pointers to references or ideas for a solution will be greatly
appreciated!!!

Thanks!!

Don

2. Menu Qeustion! Nice little icons in the menu...

3. Opening a password protected MDB file using ADO

4. INTERMITTENT 'General network errors'

5. Opening a connection with ADO to a MS Access 97 .mdb file

6. SQL Server 7.0 - Security - NT Auth.

7. A question about remote access to an .MDB file using ADO / RDS

8. Oracle DBA going on vacation - Mountain View, CA - Help

9. Using an mdb file with VB 6 ADO without Access installed

10. Linked Server Microsoft.Jet.OLEDB.4.0 to Access MDB with Workgroup/Security

11. Using ADO to open cdb files (these are actually dbf dbase IV files)

12. ( Ado Open Access MDB ) V.S. ( Ado Open SQL 7 )

13. Record locking with ADO Express, ADO 2.5 and Access 2000 .mdb files