title: Operational error at cursor when creating function in SQLite
body: <p>I am trying to insert data into my SQLite database, it goes fine until I get the error while creating a function for DB. It sends <code>OperationalError at cursor</code>.</p>
  
  <p>I couldn't find solution for my problem.</p>
  
  <p>Code I'm using:</p>
  
  <pre><code>import sqlite3
  from sqlite3 import *
  
  SQL_CREATE_STATEMENT = '''CREATE TABLE password
               (id integer PRIMARY KEY NOT NULL,username text, password text, source text)'''
  SQL_INSERT_STATEMENT = '''INSERT INTO password (username, password, source)VALUES({},{},{});'''
  
  DATABASE_PATH = 'home/taha/lessons/projects/passStorage/passDB.db'
  
  DATA = dict()
  
  
  def create_connection(db_file):
      try:
          conn = sqlite3.connect(db_file)
          return conn
      except Error as e:
          return e
  
  def create_table(connection, sql_commands):
      c = connection.cursor()
      c.execute(sql_commands)
      print('done')
  
  def get_input():
      USERNAME = input('username: ')
      PASSWORD = input('password: ')
      SOURCE = input('source: ')
      return USERNAME,PASSWORD,SOURCE
  
  def insert_date(connection, data):
      c = connection.cursor()
      c.execute(SQL_INSERT_STATEMENT.format(data.values))
  
  def main():
      conn = create_connection(DATABASE_PATH)
      create_table(conn, SQL_CREATE_STATEMENT)
  
      user_info = get_input()
      DATA['username'], DATA['password'], DATA['SOURCE'] = user_info
  
      insert_date(conn, DATA)
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I expect no error but it sends this:</p>
  
  <pre><code>c = connection.cursor()
  
  AttributeError: 'OperationalError' object has no attribute 'cursor'
  </code></pre>