Re: getObject() and shell automation question
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 18:48:07 -0400
Did you try making the change I suggested?
You may find it useful to read http://support.microsoft.com/?id=210111
(don't worry that it only mentions Access 2000: it applies to all versions)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"juneBug via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx> wrote in message
news:53A0EC63C2220@xxxxxxxxxxxxxxxxxxxx
> Doug.
>
> Thanks for replying...I am still locking horns with VBA over this...
> Here is the most recent attempt...
>
> Public Function openSecuredDBwAutomation()
> Dim accObj As Access.application, myDB As Database, myWS As
> Workspace,
> dbe As PrivDBEngine
> Dim strPathToMDWFile As String, strDefaultUser As String 'will be
> input param
> Dim strDefaultPwd As String, strPathToDatabase As String 'will be
> input param
>
> 'WILL BE INPUT PARAMS
>
> 'strPathToMDWFile = ""
> 'strDefaultUser = ""
> 'strDefaultPwd = ""
> 'strDefaultPwd = "ratesrus"
> 'strPathToDatabase = "C:\WINNT\Profiles\CTCUSER\Desktop\tester.mdb"
>
> 'OPEN WORKSPACE
> 'protected by MDW
> 'If strPathToMDWFile <> "" And strDefaultUser <> "" And strDefaultPwd
> <>
> "" Then
> ' Set myWS = CreateWorkspace("", strDefaultUser, strDefaultPwd,
> dbUseJet)
> ' ' Open the secured database.
> ' Set myDB = myWS.OpenDatabase(strPathToDatabase)
> 'Else
> 'password protection or unprotected db
> Set myWS = DBEngine.Workspaces(0)
> 'End If
>
> 'OPEN DATABASE
> 'MDW protected
> If strPathToMDWFile <> "" Then
> Set myDB = myWS.OpenDatabase _
> (strPathToDatabase, False, False, "MS Access;DATABASE=" &
> strPathToMDWFile & ";UID=" & strDefaultUser & ";PWD=" & strDefaultPwd)
> 'password protected
> ElseIf strDefaultPwd <> "" And strPathToMDWFile = "" Then
> Set myDB = myWS.OpenDatabase _
> (strPathToDatabase, False, False, "MS Access;PWD=" & strDefaultPwd)
> Else 'unprotected
> Set myDB = myWS.OpenDatabase(strPathToDatabase)
> End If
>
> 'GET ACCESS OBJECT
> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> Set accObj = getObject(strPathToDatabase, "Access.Application")
> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
>
> 'GET RECORDSOURCE
> accObj.DoCmd.OpenForm "Form1", acDesign 'open form
> MsgBox accObj.Forms("Form1").RecordSource
>
> 'accObj.CloseCurrentDatabase
> 'accObj.Quit
>
> Set accObj = Nothing
> Exit Function
> End Function
>
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200508/1
.
- Follow-Ups:
- Re: getObject() and shell automation question
- From: juneBug via AccessMonster.com
- Re: getObject() and shell automation question
- From: juneBug via AccessMonster.com
- Re: getObject() and shell automation question
- References:
- getObject() and shell automation question
- From: juneBug via AccessMonster.com
- Re: getObject() and shell automation question
- From: Douglas J Steele
- Re: getObject() and shell automation question
- From: juneBug via AccessMonster.com
- getObject() and shell automation question
- Prev by Date: Default Error Check
- Next by Date: File copy to sharepoint using MS Access
- Previous by thread: Re: getObject() and shell automation question
- Next by thread: Re: getObject() and shell automation question
- Index(es):
Relevant Pages
|