Python Forum
Check password from sqlite db
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check password from sqlite db
#1
Any help is appreciated, I'm a beginner, and I'm trying to find where is my error. I can set up a new password and insert it into the DB, but I'm not sure how can I fetch that record and match it with the Entry input. I'm getting the except error- fatal error.

the db table is system -> system_password

        self.password_entry = Entry(self.main,
                            width = 30,
                            relief = FLAT,
                            cursor = 'hand2')
        self.password_entry.focus()
        self.password_entry.grid(row = 1, column = 1, pady = 5, padx = 8)
        self.password_entry.config(show = '*', relief = FLAT)

    def chkPass(self):
        pas = self.password_entry.get()
        try:
            con = sqlite3.connection('employer.db')
            cur = con.cursor()

            query = "SELECT system_password FROM 'system'"
            cur.execute(query)
            records = cur.fetchone()
            if pas == records:
                messagebox.showinfo('Sucess', 'Welcome')
            else:
                messagebox.showerror('ERROR', 'Try again')
        except:
            messagebox.showwarning('Warning', 'Fatal Error!', icon = 'warning')


[Image: img-help.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Program regarding Password check need assistance Remediez 1 3,178 Jul-09-2018, 03:59 PM
Last Post: MasterGame

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020