title: Create a new table in access database with Python using button
body: <p>I am trying to make a new table in access database.<br>
  There should be two buttons.</p>
  
  <p>Button 1 (Browse): select the (.mdb) file where a new table would be created</p>
  
  <p>Button 2 (Run)   : create new table</p>
  
  <p>The code I wrote so far: </p>
  
  <pre><code>import pyodbc
  from Tkinter import *
  import tkFileDialog
  
  def browse():
      A = tkFileDialog.askopenfilename()
      return str (A)
  
  def run():
      conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=' + browse())
      cur = conn.cursor()
  
      if cur.tables(table = 'new').fetchone():
      cur.execute('DROP TABLE new')
  
      cur.execute('CREATE TABLE new( ID integer, Name string)')
      conn.commit()
      print (' New created')
  
  
  r = Tk()
  r.title ('test')
  r.geometry ('200x300')
  
  b1 = Button(r,text = 'Browse', command = browse).place (x = 10, y =10)
  b2 = Button (r, text = 'run', command = run).place (x = 10, y =50)
  r.mainloop()
  </code></pre>
  
  <p>The problem is when I hit run button it again ask to select the file whether run button is supposed to create a new table in the previously selected (with browse button) access database.  If anyone can show me a way.  I am using Python 2.7 and MS access 2007.</p>