def select_now():
s1 = ey1.get()
if s1 != '':
conn = pymssql.connect('', 'sa', '', 'table')
cursor = conn.cursor()
sql_select = "SELECT province,area,number FROM [table].[dbo].[Table2] where province='%s' "
data=s1
cursor.execute(sql_select)
conn.commit()
cursor.close()
conn.close()
for i in map(treeview.delete, treeview.get_children("")):
pass
treeview.update()
代码可能有不正确的地方,就是怎么实现查询