Unable to Set Database.Name Property in Python via ActiveX API
I am trying to programmatically modify the Name
property of a database connection in a BarTender document using Python and the ActiveX Automation interface. However, I'm encountering an error when attempting to set this property.
AttributeError: Property '<unknown>.Name' can not be set. (https://help.seagullscientific.com/2016/en/Subsystems/ActiveX/ActiveX.htm#Name_Property_(Database).htm%3FTocPath%3DReference%7CDatabase%2520Object%7CDatabase%2520Properties%7C_____2)
Here is a simplified version of my code:
When I run this code, I receive the following error at the line where I attempt to set db_conn.Name = new_name
:
"AttributeError: Property '<unknown>.Name' can not be set."
According to the BarTender ActiveX Automation documentation, the Name
property of the Database
object should be writable ("Sets and returns the database name"). However, it seems to be read-only when accessed via Python's win32com.client
.
Question:
Is there a way to set the Name
property of a Database
connection object in Python using the ActiveX Automation interface? If not, could you please advise on the recommended approach to programmatically rename a database connection within a BarTender document using Python?
Thank you for your assistance.
Best regards,
請登入寫評論。
評論
0 條評論