Read secured access database table from Excel

D

DJ

Hi,
I need to read a table in a secured access database using VBA in an Excel macro. For instance :
Set db = OpenDatabase(MyDatabase)
Set rst = db.OpenRecordset(MySQL)
Problem is that the database is secured (through an Access workgroup) and that above code does not allow me to open the database. Question: is this possible using VBA and if so, how?
 
N

Naresh Nichani MVP

Hi:

Take a look at this --
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndao/html/
daotoadoupdate_topic4.asp

Regards,

Naresh Nichani
Microsoft Access MVP

DJ said:
Hi,
I need to read a table in a secured access database using VBA in an Excel macro. For instance :
Set db = OpenDatabase(MyDatabase)
Set rst = db.OpenRecordset(MySQL)
Problem is that the database is secured (through an Access workgroup) and
that above code does not allow me to open the database. Question: is this
possible using VBA and if so, how?
 
T

Tim Ferguson

I need to read a table in a secured access database using VBA in an
Excel macro.

Look up help for the Workspace object in the DBEngine object. The idea is
to open a workspace object, set its security properties (mdw file,
username, password etc) and then open the database inside it.

Hope that helps



Tim F
 
G

Greg Kraushaar

Long time since I did this,
but from memory,
define a separate workspace and set the userid and password to open
it.
This was in MSA97. Since the passowrd prompt has moved to when you
open the DB MSA2K, maybe th eparameters are in the OpenDatabase now.
Look in help (mine is broken so I can't do it for you.

Regards Greg Kraushaar
Wentworth Falls Australia
(Do not email - the reply address is a Spam spoofer)
(If you really must, remove all UCase and numbers)
 

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