Delete Database Record With Treeview - Python Tkinter GUI Tutorial #178

preview_player
Показать описание
In this video I'll show you how to delete a record from our database using the Treeview and entry boxes in our Treebase app.

Deleting records from the database is pretty simple. We just connect to the database as usual, create a cursor as usual, then run one simple SQL command to delete a record with a specific ID.

When deleting records from any database, you always want to use that records unique id, or primary key, or in sqlite3's case, the rowid (oid).

#tkinter #codemy #JohnElder

Timecodes
0:00​​ - Introduction
1:43 - Connect To Database
2:23 - How Deleting From A Database Works
4:00 - Delete ID From Database
5:16 - Clear Entry Boxes
6:12 - Create Popup Box On Delete
8:21 - Conclusion
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

Hey, I managed to pull data from my database but it looks like this:
[(1, 'maths', '16p32', '28/09/2021', '2021-08-18 19:35:21')]
and what I want to do is create another list but it should contain seperated data from the first list by the character: " ' " wich is the single quote.
so i should see something like this:
print(listNumber2[0])
1,
print(listNumber2[1])
maths
print(listNumber2[2])

print(listNumber2[3])
28/09/2021
How can I do that?

hairplural
Автор

Hi John, Loving this Treeview series. Please can you include how to do a search! I now have a great CRM with 650 records, but to try and find "John" or " Elder" for example is a problem. Is there a way to include a search button and to list only the records that include the search word? Apart from a complicated total rewrite I cannot see how to add this as a feature and I think you would be breaking new ground including it. Thanks.

markal
Автор

I like your videos even I'm not watching them or already know the concept

eshaangupta
Автор

Great Tutorials Man!!! Keep Doing...we're learning a lot from your teachings...Please tell me, what should be the MAX records to be added in this Database, for the app to work properly, without hanging? Thanks in advance

ḥasan-amusnaw
Автор

Hello Again, John. I have been learning for your video for this database tkinter Python Treeview and I always stumble on the same error: cur.execute("DELETE from addresses WHERE oid =" + id_entry.get())
sqlite3.OperationalError: incomplete input

I am using VS to edit my code. I have tried with oid or rowid or _rowid_ as describe in the Sqlite3 documentation with always the same result...or error. I have looked all over and can not find a solution. Now I am thinking of completely removing the ID field but I would prefer to keep it since I would prefer to use it as Primary Key. For now I am trying to follow your tutorial as is. Thanks for your help. Hopefully you, or someone from the community will be able to help.

rejeanpion
Автор

Hi John, you said that if you were serious about this program you would delete the ID entry and probably the ID column from the treeview?
That is what im trying to do now, but I cannot figure out how to get the OID from the database for the selected record without doing it the way you're doing it in the video?

I'd appreciate any help i could get!

kevingrape
Автор

Usually problem for such type of apps - print or export data for printing from database. Create pdf of filtered data as example.

DimiEG
Автор

Hi John, it keeps give me this : c.execute('DELETE from tb_koizas WHERE oid=' + id_e.get())\n sqlite3.OperationalError: incomplete input. When I clik Delete record

konkis
Автор

Hello, what will the autocomplete primary key code look like? Please, help me

amanastya
Автор

Hi Sir, how can we re-arrange I'd numbers after deleting a record and how can we add a record at specific place in a list...

narendharsagar
Автор

Hi John. I'm a huge fan of your vids. Learned a lot. Thanks. Any idea how to display multi line text in a treeview row?

nihilith
Автор

when I delete a record and then add more records I get an error that says UNIQUE constraint failed: customers.customers_id
its like its stuck on that id number and I cant get it to move on to the next id number so it can save more entries

davekingrey
Автор

John, you are the one who created tkinter, right?

laurentreynaud
Автор

Hi, just with curiosity, can we make GUI for Python using Web Technology or web framework like NodeJS.

thelostman
Автор

hi, can you export treeview tables to excel csv file ??, thanks.

fmedrano
Автор

hey your windows was updated overnight yet, you did not.
by the way how is your family??

elitecoder
Автор

POR QUE SIEMPRE UNA TABLA, SI EN LA REALIDAD SIEMPRES SE USAN VARIAS TABLAS CONBINADAS POR QUE NO HACEN ALGO QUE SIRVA. UN EJEMPLO EN UNA PUNTO DE VENTA TENDRIAS QUE CONBINAR VARIAS TABLAS COMO LA DEL USUARIO, PRODUCTO, CLIENTE ...ETC..?

cristianosvaldovallesviza
Автор

dude good job but please design different thumbnail . all of your videos have a type of thumbnail

jacksonchh