Bilbo_Baggins_Esq
Registered User.
- Local time
- Today, 08:25
- Joined
- Jul 5, 2007
- Messages
- 586
Does anybody have any old code snippets you've used to open a Workgroup restricted MDF file using VBA.
To be clear, this is NOT via ADODB or DAO.
This needs to be within an Access.Application Object.
I have code that uses objOrigin.OpenCurrentDatabase just fine for any unprotected database.
but I cannot seem to figure out how to pass the MDW though with the user id and password
here is the LATEST incarnation of what I've been trying.
IT IS NOT all I have done and is only provided to show some premise of a few of the syntax's I have already tried.
the last incarnation posted above tries to pass the mdw, userid and pwd using the password argument of the .OpenCurrentDatabase method.
HOWEVER, I have also tried it by piecing all of it together (ala old fashioned "shortcut properties") as you can see from some of the remarked strings.
I'm hoping maybe somebody might have some old code they used to use that can be dusted off?!?!?!
To be clear, this is NOT via ADODB or DAO.
This needs to be within an Access.Application Object.
I have code that uses objOrigin.OpenCurrentDatabase just fine for any unprotected database.
but I cannot seem to figure out how to pass the MDW though with the user id and password
here is the LATEST incarnation of what I've been trying.
IT IS NOT all I have done and is only provided to show some premise of a few of the syntax's I have already tried.
Code:
OriginDB = "C:\Users\mf86228\Desktop\csu2005_FE.mdb"
[COLOR="DarkGreen"]'OriginDB = Chr(34) & "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" & Chr(34) & " /wrkgrp " & Chr(34) & "C:\Users\mf86228\Desktop\csu.mdw" & Chr(34) & " /User " & Chr(34) & "sys adm telecoms" & Chr(34) & " /pwd " & Chr(34) & "lisakri" & " " & Chr(34) & "C:\Users\mf86228\Desktop\csu2005_FE.mdb" & Chr(34)
'OriginDB = Chr(34) & "C:\Users\mf86228\Desktop\csu2005_FE.mdb" & Chr(34) & " /wrkgrp " & Chr(34) & "C:\Users\mf86228\Desktop\csu.mdw" & Chr(34) & " /User " & Chr(34) & "sys adm telecoms" & Chr(34) & " /pwd " & Chr(34) & "lisakri" & Chr(34)
'OriginDB = "C:\Users\mf86228\Desktop\csu2005_FE.mdb /wrkgrp C:\Users\mf86228\Desktop\csu.mdw /User " & Chr(34) & "sys adm telecoms" & Chr(34) & " /pwd " & Chr(34) & "lisakri" & Chr(34)
'MsgBox OriginDB
'"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" /wrkgrp "C:\Users\mf86228\Desktop\csu.mdw" /User "sys adm telecoms" /pwd "lisakri" "C:\Users\mf86228\Desktop\csu2005_FE.mdb"[/COLOR]Set objOrigin = CreateObject("Access.Application")
With objOrigin
.OpenCurrentDatabase OriginDB, True, "C:\Users\mf86228\Desktop\csu.mdw /User " & Chr(34) & "sys adm telecoms" & Chr(34) & " /pwd " & Chr(34) & "lisakri" & Chr(34)
.Visible = False
End With
the last incarnation posted above tries to pass the mdw, userid and pwd using the password argument of the .OpenCurrentDatabase method.
HOWEVER, I have also tried it by piecing all of it together (ala old fashioned "shortcut properties") as you can see from some of the remarked strings.
I'm hoping maybe somebody might have some old code they used to use that can be dusted off?!?!?!