I'm not sure what you're trying to do in Onupdate, but the code you have
is wrong:
old_name = MainPanel(MainFrame).getValue()
That line will create a brand new MainPanel, passing the "MainFrame"
class (not an INSTANCE of that class) as the first parameter. That's
clearly wrong. I don't think you are storing the "old name" anywhere;
perhaps you need to save a copy of it in your "setValues" function.
In several places, you have a similar problem when you write
DataOperation().table_name. That creates a brand new object each time.
Instead of that, you should create a single DataOperation() object and
store it in a member variable. You even do that inside the
DataOperation class in the "insert" method, where you should use "self"
instead.
The SQL in Onupdate is also wrong. You need to use parameter
substitution, just like you did in the INSERT calls above. As it is,
your UPDATE call merely replaces the name, tel, and fax fields with
copies of their existing values.
I have attached something that makes these changes. I don't have
ObjectListView, so I'm not sure this is entirely right, but it should
get you started.
--
Tim Roberts,
ti...@probo.com
Providenza & Boekelheide, Inc.