<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I'm sorry, but you are very unlikely to find anyone on this list
with erwin experience. pywin32 is a general purpose library that
allows talking to *any* COM object, so there are literally
hundreds and hundreds of different apps it can work with. I've
never even heard of erwin and have no idea what it does :( You
might fine someone else on this list has, and can help you, but in
the meantime...<br>
</p>
<p>You really need to find support for the erwin app, not pywin32.
Because COM works in any language, you might find the help you
need is written in terms of a language other than Python, but the
answer should translate across to Python.<br>
</p>
<p>Good luck,</p>
<p>Mark<br>
</p>
<div class="moz-cite-prefix">On 2023-05-17 5:39 a.m., Pranav S Pawar
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CABQoSP39GONRvN26PJ1S4UbkXDk_8eriZTBsRnha7hDUwcE2JQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hello Team,
<div><br>
</div>
<div>I am getting an error while using
persistence_units.CloseAll() method of persistence_units
module. of win32com</div>
<div><br>
</div>
<div>Error: <span
class="gmail-ansi-red-intense-fg gmail-ansi-bold"
style="font-size:14px;white-space:pre-wrap;box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">AttributeError</span><span
style="color:rgb(0,0,0);font-size:14px;white-space:pre-wrap">: '<win32com.gen_py.erwin Data Modeler Script Client API Type Library.ISCPersistenceUnitCollection instance at 0x3171750852880>' object has no attribute 'CloseAll'</span></div>
<div><br>
</div>
<div>Below is my code where i am trying to access and erwin
datamodel , check connection and close connection.<br>
<div><br>
</div>
<div>i<i>mport win32com.client as win32<br>
<br>
# Create an instance of the erwin API<br>
erwin_api = win32.Dispatch("erwin9.SCAPI")<br>
<br>
# Connect to erwin Data Modeler Mart or local repository<br>
# Get the PersistenceUnits collection<br>
persistence_units = erwin_api.PersistenceUnits<br>
<br>
# Open an existing persistence unit<br>
existing_persistence_unit =
persistence_units.Add(r"D:\\testdm.erwin")<br>
print("Opened existing persistence unit:",
existing_persistence_unit.Name)<br>
<br>
# Close all persistence units<br>
persistence_units.CloseAll()<br>
print("Closed all persistence units")<br>
<br>
# Save changes to all persistence units<br>
#persistence_units.SaveAll()<br>
print("Saved changes to all persistence units")</i><br>
</div>
<div><br>
</div>
<div>Can you please let me know, what is the correct method if
CloseAll is not the correct method.</div>
<div>Is there any link where I can get all the methods of
erwin_api.PersistenceUnits ?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Pranav</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
python-win32 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:python-win32@python.org">python-win32@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-win32">https://mail.python.org/mailman/listinfo/python-win32</a>
</pre>
</blockquote>
</body>
</html>