Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import sqlite3
sqlite3.version
'2.6.0'
import sqlite3
con = sqlite3.connect('todo.db')
con.execute('CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL,NAME TEXT NOT NULL,AGE INT NOT NULL,ADDRESS CHAR(50),SALARY REAL);')
print "Table created successfully";
print "Opened database successfully";
con.commit()
when i m trying to execute the above code using python then i m getting the below issue. Can anyone assist with the solution to resolve this issue.
C:\Users\RANJITH KUMAR>python todo.db
Traceback (most recent call last):
File "todo.db", line 3, in
con.execute('CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL,NAME TEXT NOT NULL,AGE INT NOT NULL,ADDRESS CHAR(50),SALARY REAL);')
sqlite3.DatabaseError: file is encrypted or is not a database
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import sqlite3 con = sqlite3.connect('todo.db') con.execute('CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL,NAME TEXT NOT NULL,AGE INT NOT NULL,ADDRESS CHAR(50),SALARY REAL);') print "Table created successfully"; print "Opened database successfully"; con.commit()
when i m trying to execute the above code using python then i m getting the below issue. Can anyone assist with the solution to resolve this issue.
C:\Users\RANJITH KUMAR>python todo.db Traceback (most recent call last): File "todo.db", line 3, in
con.execute('CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL,NAME TEXT NOT NULL,AGE INT NOT NULL,ADDRESS CHAR(50),SALARY REAL);')
sqlite3.DatabaseError: file is encrypted or is not a database