#python-3.x
#python-3.x
Вопрос:
Я работаю над базой данных SQLite с помощью tkinter с графическим интерфейсом проблема в том, что всякий раз, когда я сохраняю данные, отображается ошибка.
def save (self):
with sqlite3.connect('account.db') as db:
c = db.cursor()
# Find Existing username if any take proper action
find_info = 'SELECT * FROM user WHERE name = ?'
c.execute(find_info, [(self.name.get()), (self.StudentNumber.get()),(self.attendance.get()),(self.quiz.get()),(self.project.get()), (self.actual.get()), (self.final_exam.get()),(self.final_Grade.get())])
if c.fetchall():
ms.showerror('Error!', 'Could not find DATA.')
else:
ms.showinfo('Success!', 'Data CREATED!')
# Create New Account
insert = 'INSERT INTO user (name, student number, attendance, quizzes, project, actual examinations) VALUES(?,?,?,?,?,?,?,?)'
c.execute(insert, [(self.name.get()), (self.StudentNumber.get()), (self.attendance.get()), (self.quiz.get()),
(self.project.get()), (self.actual.get()), (self.final_exam.get()),(self.final_Grade.get())])
db.commit()
self.moon()
Exception in Tkinter callback
Traceback (most recent call last):
File "C:Program FilesPython37libtkinter__init__.py", line 1702, in __call__
return self.func(*args)
File "C:/Users/IAC-PC8/PycharmProjects/SKIN/OB.py", line 241, in save
c.execute(find_info, [(self.name.get()), (self.StudentNumber.get()),(self.attendance.get()),(self.quiz.get()),(self.project.get()), (self.actual.get()), (self.final_exam.get()),(self.final_Grade.get())])
sqlite3.OperationalError: no such column: name