You've got a couple of responses over in the WSH newsgroup to this message;
it appears that Access itself chooses to show its main window, as explained
by Sergei Zhirikov. There is at least one workaround, starting via Access
automation, as shown over there (and repeated here):
Set access = CreateObject("Access.Application")
access.OpenCurrentDatabase(FOLDERPATH & SCHEDULERFILE, true)
"JonWayn" <> wrote in message
news:15BA8145-7AA0-452E-AF87-...
> I have a VBScript script that is pretty simple: it opens a microsoft
> access
> database. The problem is, it should open it hidden, with the second
> argument
> to the wscript run command being 0, but it doesnt do so. Any suggestions?
> Here's the script:
>
> Const FOLDERPATH = "C:\Working\Access\All County\"
> Const SCHEDULERFILE = "Scheduler.mdb"
> Const LDBFILE = "Scheduler.ldb"
> Const WINDOWVIEWSTATE_HIDE = 0
> Const ERRPERMISSIONDENIED = 70
>
> Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
> On Error Resume Next
>
> If FSO.FileExists(FOLDERPATH & LDBFILE) Then
> FSO.DeleteFile FOLDERPATH & LDBFILE
>
> If Err.Number = ERRPERMISSIONDENIED Then
> Wscript.Echo "Scheduler already running"
> Wscript.Quit
> End If
> End If
>
> set objShell = Wscript.CreateObject("Wscript.Shell")
> objShell.Run """" & FOLDERPATH & SCHEDULERFILE & """",
> WINDOWVIEWSTATE_HIDE,
> -1
>
|