Issue with OLE to create AB instance


I use a VBScript to create AB instance and load a database:

Dim amiBrokerApp
Set amiBrokerApp = CreateObject("Broker.Application")
amiBrokerApp.Visible = 1

I’m seeing to run it on different DOS prompt sessions to open separated instances, however it appears it returns only the first created instance.

I tested the same script to create Excel instance, it works correctly new instance is created in each session call:


Anyone knows what I could have missed and have a way work around this? I’m on Windows 10.


There is no issue. This is how OLE works.
OLE by default always uses already running instance (first one). This (among other things) allows to
connect to RUNNING instance (like AmiQuote wanting to update your RUNNING AmIBroker) instead of creating another instance which would be useless because you won’t be able to update your currently running DB.

If you want multiple instances via OLE you have to use multiple Windows users as each user in Windwos has its own OLE session.