Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Load & display a secured DB without having to type the password

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Georges - 31 Jan 2008 20:11 GMT
Hello

Is possible to open a database that is protected by a global password (Tools
Menu, Security, Set Database Password...) programmatically from another
database and without having Access prompt the user to enter the password?

I've tried almost everything... but hope there is still a solution that I
haven't seen

The function OpenDatabase returns a database and it works fine (with a
Microsoft Jet workspace or ODBCDirect).

Set db = DBEngine.Workspaces(0).OpenDatabase("C:\Program Files\Microsoft
Office\Office10\Samples\Northwind.mdb", False, False, "MS
Access;PWD=northwind")

The database is loaded, but there is no Display property or anything to
bring it to the screen..

There is an alternative to this using the Shell command where the
password/userId can be set. But it concerns the user's/group's workspace
password. and this password is not sufficient, since a vicious person can
create a new access file and import all the database objects without having
to enter any password if the 'general' password is not defined.

Thanks for any relevant hint or suggestion!
Best regards
Klatuu - 31 Jan 2008 20:27 GMT
Dim Ldb As DAO.Database

   Set Ldb = DBEngine.OpenDatabase(strRealProContract, _
       False, False, ";pwd=YourDatabasePasswordHere")
Signature

Dave Hargis, Microsoft Access MVP

> Hello
>
[quoted text clipped - 23 lines]
> Thanks for any relevant hint or suggestion!
> Best regards
Klatuu - 01 Feb 2008 17:11 GMT
Thanks for sharing that.
Signature

Dave Hargis, Microsoft Access MVP

> Dim Ldb As DAO.Database
>
[quoted text clipped - 28 lines]
> > Thanks for any relevant hint or suggestion!
> > Best regards
Klatuu - 31 Jan 2008 20:29 GMT
Sorry, I answered before I read the entire post.

You will  see no UI of any kind when you open an external database.  You
have to manipulate the external database's objects programmatically.

Signature

Dave Hargis, Microsoft Access MVP

> Hello
>
[quoted text clipped - 23 lines]
> Thanks for any relevant hint or suggestion!
> Best regards
Georges - 01 Feb 2008 16:57 GMT
Here is the answer to my question found on the MS website!! :-)
http://support.microsoft.com/kb/235422/
'============================================================
Option Compare Database
Option Explicit

Sub OpenPasswordProtectedDB()
  'Définit la valeur Static de façon à ce que l'instance de Microsoft
Access
  'ne se ferme pas lorsque la procédure est terminée.
  Static acc As Access.Application
  Dim db As DAO.Database
  Dim strDbName As String
  strDbName = "C:\Program Files\Microsoft
Office\Office\Samples\Northwind.mdb"
  Set acc = New Access.Application
  acc.Visible = True
  Set db = acc.DBEngine.OpenDatabase(strDbName, False, False, ";PWD=nwind")
  acc.OpenCurrentDatabase strDbName
  db.Close
  Set db = Nothing
End Sub
'============================================================

> Hello
>
[quoted text clipped - 25 lines]
> Thanks for any relevant hint or suggestion!
> Best regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.