Answer the question
In order to leave comments, you need to log in
How to get rid of COM connection error with 1C Python script?
Good afternoon! Help with COM connection error with 1C Python script?
The actual error:
com_error: (-2147024891, 'Access is denied.', None, None)
import pythoncom
import win32com.client
V83_CONN_STRING = "Srvr=srv01-w2k8;Ref=base_7;Usr=Администратор;Pwd=1;"
pythoncom.CoInitialize()
V83 = win32com.client.Dispatch("V83.COMConnector").Connect(V83_CONN_STRING)
Answer the question
In order to leave comments, you need to log in
If 1C is 32-bit, then you need to do the following:
The V81.Application object runs under the new 1cv8.exe process.
The V81.COMConnector object is an in-process server. There is no process on the remote computer in which it can be created.
To create a V81.COMConnector object on a remote computer, registering the comcntr.dll component in COM with the regsvr32.exe utility is not enough. You need to register the comcntr.dll component as a COM+ application on a remote computer.
To do this:
* run the Component Services utility;
* create an empty COM+ application with:
o Activation type - Server application;
o name, for example, V81_COMConnector;
o Specify the name of the Windows user under whose name the component will launch the special process dllhost.exe;
* In the Components branch, add a new component comcntr.dll from the 1C:Enterprise load modules directory.
As a result, when the V81.COMConnector object is created, a special system process dllhost.exe will be launched on the remote computer, and the V81.COMConnector object will be created in it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question