You can simply pass a string and two empty lists like:

titles, positions = GetTableInfo("TABLENAME", [], [])


Am 25.09.2024 um 13:41 schrieb Alessandro Fiorino:

I have to call a method of a COM Object which is defined as
GetTableInfo ([in] BSTR bstrTableName,[in, out] SAFEARRAY(BSTR)*bstrColumnTitles,[in, out] SAFEARRAY(long)*lColumnPos)

I tried with
            columnTitles = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_BSTR, [None])             columnPos = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_I4, [None])
            object.GetTableInfo("TABLENAME", columnTitles, columnPos)
and with
            columnTitles = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_BSTR, [""])
            columnPos = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_I4, [0])
            object.GetTableInfo("TABLENAME", columnTitles, columnPos)

but I get an error:
Object ot type VARIANT has no len()

What I am doing wrong ?

Thanks in advance.


_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to