Python Forum
Database connection problems [login, PyQt5, PySql]
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database connection problems [login, PyQt5, PySql]
#2
BSLoginDialog connects db_manager when created. on_login_clicked() closes db_manager. If you call on_login_clicked() a second time there is no connection and the query fails.

You could modify your code to only close the connection when the dialog is closed, but I think a better solution is to connect and close the connection each time you want to check user credentials.
Reply


Messages In This Thread
RE: Database connection problems [login, PyQt5, PySql] - by deanhystad - Dec-14-2023, 07:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "ModuleNotFoundError: No module named 'PyQt5.QtWidgets'; 'PyQt5' is not a package" chipx 3 10,802 Dec-09-2021, 07:05 AM
Last Post: chipx
  pysql connection to cloud server database times out Pedroski55 9 7,597 Oct-11-2021, 10:34 PM
Last Post: Pedroski55
  Serial connection connection issue Joni_Engr 15 12,652 Aug-30-2021, 04:46 PM
Last Post: deanhystad
  in a login interface when i try login with a user supposed to say test123 but nothing NullAdmin 3 3,241 Feb-20-2021, 04:43 AM
Last Post: bowlofred
  Connection DATABASE to Python MenThoLLt 3 3,216 Jan-17-2020, 10:35 PM
Last Post: DT2000
  Unable to login to remote SQL Server database sipriusPT 1 16,757 Dec-20-2019, 10:16 AM
Last Post: sipriusPT
  Problems converting pyqt4 script to pyqt5 using pyqt4topyqt5.py Vysero 1 3,449 Jul-31-2018, 08:56 PM
Last Post: Axel_Erfurt
  Error in running MS Access Database connection code pyuser1 4 9,367 Feb-01-2018, 08:28 PM
Last Post: pyuser1
  Connection to MS SQL Database not working mruprai 1 3,410 Sep-25-2017, 03:58 PM
Last Post: buran

Forum Jump:

User Panel Messages

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