|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Programmer's Guide > DBWorks StandAlone Server > DBWorks Stand Alone Server extended support |
The DBWorks Standalone Server can now be instantiated with a Wshell.Run() command in order to have it always being loaded in memory, so being faster in it's operations when called from a VB/VBScript application.
The DBWAlone.EXE executable supports now the special command line option NoStartApplication that will avoid that DBWAlone.exe will connect to the database and open the browser just after launching it.
A typical sample of the calls for using DBWAlone with this specific feature is the following:
Set WShell = CreateObject("WScript.Shell")
WShell.Run(chr(34) & "C:\Program Files\DBWorks Stand Alone\Bin\DBWAlone.exe" & chr(34) & " -NoStartApplication")
set dbwapp = Nothing
retries = 0
do
WScript.Sleep(500)
On error resume next
Set dbwapp = GetObject(,"DBWAlone.Api")
On error goto 0
retries = retries+1
Loop while dbwapp is Nothing and retries<100
if dbwapp is Nothing then
DBWMsgBox "GetObject failed!"
Set dbwapp = CreateObject("DBWAlone.Api")
end if
dbwapp.CallBack("OpenForBrowsing")
Please note that the call to the Wscript.Sleep is VERY important for avoiding the GetObject(,...) to be executed before the GetObject support itself being created in the running DBWAlone.EXE process.