N
Noel
Hello,
Could you help me for that :
Context : I want to open an ACCESS (2003/XP) .mdb data base, under the
control of a rights setting file .mdw.
Problen : rights apply to the data base within ACCESS it-self. So, I need to :
- Open ACCESS ;
- Apply rights ;
- Load data base.
Within VBA EXCEL or OUTLOOK code, I code :
Private AAASub()
Dim AccessApplication As Access.Application
Shell "MSAccess.exe", vbNormalFocus
Set AccessApplication = GetObject(, "Access.Application")
AccessApplication.SetDefaultWorkgroupFile "C:\APath\ARightsDefinitionFile.mdw"
AccessApplication.OpenCurrentDatabase "C:\AnOtherPath\ADataBaseFile.mdb"
'Here the user is doing what he as to do, then closes ACCESS
AccessApplication.SetDefaultWorkgroupFile "C:\Docu...Soft\Access\System.mdw"
AccessApplication.Quit
Let AccessApplication = Nothing
MsgBox "Bye"
End Sub
This is running allright when there is not any else instance of ACCESS
loaded before. If an instance of ACCESS was loaded before (or several),
GetObject get always the last loaded before, which is not the one I hope, and
the code goes until the end without any stop.
Is there a method to associate the ACCESS loaded by Shell and the ACCESS
object ?
Ali and Klatuu deals about something similar between 5/23/2008 and
5/29/2008, but the thread stopped before solution ...
Thanks a lot,
Noel
Could you help me for that :
Context : I want to open an ACCESS (2003/XP) .mdb data base, under the
control of a rights setting file .mdw.
Problen : rights apply to the data base within ACCESS it-self. So, I need to :
- Open ACCESS ;
- Apply rights ;
- Load data base.
Within VBA EXCEL or OUTLOOK code, I code :
Private AAASub()
Dim AccessApplication As Access.Application
Shell "MSAccess.exe", vbNormalFocus
Set AccessApplication = GetObject(, "Access.Application")
AccessApplication.SetDefaultWorkgroupFile "C:\APath\ARightsDefinitionFile.mdw"
AccessApplication.OpenCurrentDatabase "C:\AnOtherPath\ADataBaseFile.mdb"
'Here the user is doing what he as to do, then closes ACCESS
AccessApplication.SetDefaultWorkgroupFile "C:\Docu...Soft\Access\System.mdw"
AccessApplication.Quit
Let AccessApplication = Nothing
MsgBox "Bye"
End Sub
This is running allright when there is not any else instance of ACCESS
loaded before. If an instance of ACCESS was loaded before (or several),
GetObject get always the last loaded before, which is not the one I hope, and
the code goes until the end without any stop.
Is there a method to associate the ACCESS loaded by Shell and the ACCESS
object ?
Ali and Klatuu deals about something similar between 5/23/2008 and
5/29/2008, but the thread stopped before solution ...
Thanks a lot,
Noel