title: How can i access Views instance of Tables in ODBC using pyodbc
body: <p>I want to access my database by using python script .</p>
  <p>I can able to access all table by using</p>
  <p><code>SELECT * FROM poorvika1.payment;</code></p>
  <p>But i want to access the query by using VIEW Statement</p>
  <p><code>SELECT * FROM poorvika1.pymentview;</code></p>
  <p>This is my python script</p>
  <pre><code>import pyodbc
  
  for py in pyodbc.drivers():
      print(py)
      
      
  connection =pyodbc.connect(driver='SQL Server',server='localhost',database='test',uid='test',password='root')
  
  
  cursor = connection.cursor()
  
  for row in cursor.tables():
      print(row.table_name)
  
  </code></pre>
  <p>This Query is not working</p>
  <pre><code>cursor.execute('SELECT * FROM poorvika1.pymentview')
  </code></pre>
  <p><img src="https://i.stack.imgur.com/tbNGT.png" alt="enter image description here" /></p>
  <p>I want to access view  query in pyodbc package</p>