Re: protected acces db and Office automation

What are you trying to do with the open database?
If you just want to pull data from the db, you probably want to use DAO or ADO to connect to the database, which both allow you to specify a user id and password.

Re: protected acces db and Office automation

Hi,

I am trying to put data from Word into the access db including the word file itself in an OLE field which can be done (as far as I could find now) only using a form field property.

I found this in the MS KB that seems to fit to what I am trying to do (although it seems painful) :
------------------------------------------------------------
Global Const AccessPath = "C:Program FilesMicrosoft OfficeOfficemsaccess.exe"
Global Const AccSecurdb = "M:InformatiqueFonctionnelCommunrefdoc.mdb"

Re: protected acces db and Office automation

I know you can do this using ADO (you set the 'Jet OLEDDB:System database' property of the Connection object to the relevant workgrop file and then pass the UserId and Password to the Open method of the Connection object).

I wasn't aware that this could be achieved using DAO though. In the past I have had to shell out to a new instance of Access (you can then use the /user and /password switches) and then use GetObject() to work with it.

Please enlighten me if you know how to achieve this in DAO. (I.E open an Access database secured with full User-Level security)

Re: protected acces db and Office automation

Re: protected acces db and Office automation

I don't think so. You can pass in a username and password, but they must be present in the current Workgroup. You cannot (or so I believe) open another database that has it's own MDW file with it's own names and passwords.

Re: protected acces db and Office automation

I can't say I've ever done it - there are only 15 people in my company so more than one workgroup would be a bit excessive. I don't suppose you can set the DBEngine.SystemDB property if you're already in an Access app? I can't think of another way to do it. Maybe someone else can confirm or deny whether it can be done.

Re: protected acces db and Office automation

What that is doing is shelling to the Access executable using the username and password for that database. You could extend this by including the /wrkgrp switch and the full path and filename of the mdw for that workgroup.

Once you've passed the command line arguments, your OpenCurrentDatabase should work with the protected MDB...as long as you got all the arguments right. I dont' think you would be able to do this from Access itself, but it should work from Word.