Robert Gracie
Subscriptions at servicexp.com
Mon Jun 16 17:25:11 CDT 2003
Well for those who care to know, the code below shells out the process.. So
simply, but man, did it take me a while to get it right....
Sub sOpenDBWithPwd()
Dim strDB As String
Dim strWG As String
Dim strCmd As String
Dim objSecuredDB As Access.Application
Dim SecuredDB As String
On Error GoTo HandleErr
strDB = """C:\Program Files\ServiceXp\SXPMANT.mdb"""
strWG = """C:\Program Files\ServiceXp\SXPSEC.mdw"""
strCmd = SysCmd(acSysCmdAccessDir) & "MSAccess.exe " _
& strDB & " /wrkgrp " & strWG _
& " /user Administrator" & " /pwd adminpassword"
Call Shell(strCmd, vbNormalNoFocus)
DoEvents: DoEvents: DoEvents
'Set objSecuredDB = GetObject(strDB) ' If you wan't to set the focus to
the newly opened db
ExitHere:
Exit Sub
' Error handling block added by Error Handler Add-In. DO NOT EDIT this block
of code.
' Automatic error handler last updated at 06-09-2003 18:58:17
'ErrorHandler:$$D=06-09-2003 'ErrorHandler:$$T=18:58:17
HandleErr:
Select Case Err.Number
Case -2147467259 ' Error is caused by somthing to do with the
toolbars not refreshing fast enough, very strange
Resume Next
Case -2147221020 'Cant find the cause of this error, although
ignoring it doesn't seem to cause any problems
Resume Next
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description,
vbCritical, "crypt.sOpenDBWithPwd" 'ErrorHandler:$$N=crypt.sOpenDBWithPwd
'Log Error
Call ErrorRecordSystem(Err.Number, Err.Description, Now,
"Un-Expected Error In Proc; " & "crypt.sOpenDBWithPwd", CurrentUser())
'ErrorHandler:$$N=crypt.sOpenDBWithPwd
End Select
' End Error handling block.
End Sub
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Drew Wutka
Sent: Monday, June 16, 2003 5:39 PM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] OT: the "Education" system
Hmmm, so you think you realized something afterwards, that you hadn't pin
pointed before?
Drew
-----Original Message-----
From: Tina Norris Fields [mailto:tinanfields at torchlake.com]
Sent: Monday, June 16, 2003 4:07 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] OT: the "Education" system
Drew,
Oh yes, you probably are "up hill" of most of the people you ever will
meet. So are many of the contributors on this list. What surprised me
was that I didn't know until after I had the degree that I had ever felt
"down hill."
Tina
Drew Wutka wrote:
>Interesting.
>
>I have never really felt 'downhill' though. In fact, many times I feel
like
>I am uphill from people with degrees, because I see the solution, and they
>are flapping in the wind. Oh well.
>
>Drew
>
>
>
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com