Re: Keep it alive



Hi Allen!
Thanks for your answer!

It does answer my question. The only thing is that he doesn't show the code
of how it is made. Even if it's made in VB6 or any other language.
So I cannot use it because I want to open the second DB that is secured with
a password (not a workspace password) without asking the user to type it if
his Windows login is recognized.
The code below allows me to do it, but the second DB closes immediately
after that I've closed the current DB.

'===============================================
Sub OpenPasswordProtectedDB()
'Found on MS website http://support.microsoft.com/kb/235422/
Static acc As Access.application
Dim db As DAO.Database, pathDb As String

Shell "MsAccess", vbNormalFocus
Set acc = GetObject("", "Access.Application") 'Take the Access
application that has no database open

acc.Visible = True
Set db = acc.DBEngine.OpenDatabase(pathDb, False, False,
";PWD=myPassword")
acc.OpenCurrentDatabase "C:\Program Files\Microsoft
Office\Office10\Samples\Northwind.mdb"
Docmd.Quit
End Sub
'===============================================

Thanks again for any sugestion!



"Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx> a écrit dans le message de news:
Ohn3XAUZIHA.5208@xxxxxxxxxxxxxxxxxxxxxxx
Not sure if michka's TSOON application will do what you need:
TSI SOON (Shut One, Open New) database add-in
at:
http://www.trigeminal.com/lang/1033/utility.asp?ItemID=8#8

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Georges" <georges@xxxxxxxxx> wrote in message
news:47a379c9$0$21475$5402220f@xxxxxxxxxxxxxxxxxx
Hello!

Is it possible to declare an Access.Application object in a module of
another db (let's call it db1), display the application window to the
user interface and keep it alive even when db1 is closed?

Because the database object is closed as soon as the memory used by db1
is released..

Thanks for any suggestion!



.



Relevant Pages

  • Re: What is the name of the Language we are using & recommend book
    ... Can I have 2 sub forms in a form that are not sub forms of the other sub ... As for my process I am trying to create my Access Database in shells like ... QSL or Microsoft SQL Server Data Engine or what. ... language of queries, and the query design grid is just a tool to construct ...
    (microsoft.public.access.formscoding)
  • Re: Custom Login Screen
    ... Private Sub cmdLogin_Click ... On Error GoTo ErrorHandler ... You will need to enter your full path to the database file and MDW file in the appropriate places. ... Now make an MDE file from this MDB. ...
    (microsoft.public.access.security)
  • Re: Jeff C
    ... properly secure an Access database. ... Private Sub Form_Open ... Resume ExitPoint ... Dim db As DAO.Database ...
    (microsoft.public.access.formscoding)
  • Re: How to use a logon screen to log into a secured Database?
    ... > that appears with a secured database. ... >>On Error GoTo ErrorHandler ... >> Exit Sub ... Now make an MDE file ...
    (microsoft.public.access.security)
  • Re: linking databases
    ... Doug Steele, Microsoft Access MVP ... Sub chrCountry_AfterUpdatestring highlighted in yellow.The code as I ... I using the text box's [Event Procedure] After Update property on the ... The name of the column in the table in the 2nd database I want to ...
    (microsoft.public.access.externaldata)