J
Javier G via AccessMonster.com
Hi,
How can I refresh my new active MDW by code ?
I'm using Access 2003 with the following code to link to the new active MDW,
Private Sub Command21_Click()
Dim dbe As DAO.PrivDBEngine
Dim wrk As DAO.Workspace
Dim dbs As DAO.Database
Set dbe = New PrivDBEngine
dbe.SystemDB = CurrentProject.Path & "\" & "MyNewActiveMDW.mdw"
dbe.DefaultUser = CurrentUser
Set wrk = dbe.Workspaces(0)
Set dbs = wrk.OpenDatabase(CurrentDb.Name)
Set dbs = Nothing
Set wrk = Nothing
Set dbe = Nothing
MsgBox "FINNISH,......BUT NOT REFRESH !"
End Sub
But untill I do Not close and open again the BD it does Not take any effect.
Even if I check Tools-->Secury-->Workgroup Admin shows "MyNewActiveMDW.mdw"
but when I check by code show something deferent:
MsgBox "MDW (method 1)= " & SysCmd(acSysCmdGetWorkgroupFile)
MsgBox "MDW (method 2)= " & DBEngine.SystemDB
Shows me the old MDW = SYSTEM.MDW
How can I refresh my new active MDW by code whith out closing and opening
again the BD or via MENU Tools ??
thank you !
How can I refresh my new active MDW by code ?
I'm using Access 2003 with the following code to link to the new active MDW,
Private Sub Command21_Click()
Dim dbe As DAO.PrivDBEngine
Dim wrk As DAO.Workspace
Dim dbs As DAO.Database
Set dbe = New PrivDBEngine
dbe.SystemDB = CurrentProject.Path & "\" & "MyNewActiveMDW.mdw"
dbe.DefaultUser = CurrentUser
Set wrk = dbe.Workspaces(0)
Set dbs = wrk.OpenDatabase(CurrentDb.Name)
Set dbs = Nothing
Set wrk = Nothing
Set dbe = Nothing
MsgBox "FINNISH,......BUT NOT REFRESH !"
End Sub
But untill I do Not close and open again the BD it does Not take any effect.
Even if I check Tools-->Secury-->Workgroup Admin shows "MyNewActiveMDW.mdw"
but when I check by code show something deferent:
MsgBox "MDW (method 1)= " & SysCmd(acSysCmdGetWorkgroupFile)
MsgBox "MDW (method 2)= " & DBEngine.SystemDB
Shows me the old MDW = SYSTEM.MDW
How can I refresh my new active MDW by code whith out closing and opening
again the BD or via MENU Tools ??
thank you !