I'm attempting to implement the equivalent of a VB program in python using COM. Here are the relevant lines from the VB program:
eConCall = New Microsoft.Dynamics.GP.eConnect.eConnectMethods
eConCall.eConnect_EntryPoint(sConnectionString, EnumTypes.ConnectionStringType.SqlClient, myXmlDocument, EnumTypes.SchemaValidationType.None)
In Python, I'm doing:
import win32com.client
eConCall = win32com.client.Dispatch("Microsoft.Dynamics.GP.eConnect.eConnectMethods")
but eConCall
doesn't have a eConnect_EntryPoint
method. In fact it doesn't seem to have any methods:
eConCall = win32com.client.gencache.EnsureDispatch("Microsoft.Dynamics.GP.eConnect.eConnectMethods")
dir(eConCall)
Prints:
['CLSID', '_ApplyTypes_', '__doc__', '__eq__', '__getattr__',
'__init__', '__module__', '__ne__', '__repr__', '__setattr__',
'_get_good_object_', '_get_good_single_object_', '_oleobj_',
'_prop_map_get_', '_prop_map_put_', 'coclass_clsid']
I'm pretty sure I'm misunderstanding how Dispatch should be used and how I should be getting access to eConnectMethods
in Python. Can a kind soul help me out? How would I get a hold of an instance of eConnectMethods such that I can call eConnect_EntryPoint
on it?