Necesito saber como comparar datos ya introducidos en la base de datos con los obtenidos
Publicado por Miguel (3 intervenciones) el 15/11/2019 00:57:55
Necesito saber como comparar datos ya introducidos en la base de datos con los obtenidos en la caja de texto, esto lo voy a poner dentro de la función Continuar
Este es mi código:
Y esta es mi base de Datos que cree en otro archivo de python:
Este es mi código:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import os
from tkinter import *
from tkinter import messagebox
import sqlite3
from tkinter import PhotoImage
from tkinter import ttk
import commands
#Aviso de integrantes
def PreL():
messagebox.showinfo("Integrantes","")
#---------------------------------------------------------------------
def Continuar():
miConexion = sqlite3.connect("Base Registro_de_Usuario")
miCursor=miConexion.cursor()
miConexion.commit()#Nos permite ejecutar todod el proceso anterior
VU=Tk()
VU.resizable(0,0)
VU.title("Inicio de Sesion")
VU.iconbitmap("iconop.ico")
VU.geometry("650x650+370+25")
VU.config(bg="black")
miContra=StringVar()
miDepa=StringVar()
miTipoU=StringVar()
miU=StringVar()
#-----------Label------------
lb1 = Label(VU, text="Usuario:")
lb1.place(x=105, y=440)
lb1.config(width=10, font='Helvetica 20 bold',relief=RIDGE)
lb2 = Label(VU, text="Contraseña:",relief=RIDGE)
lb2.place(x=105, y=500)
lb2.config(width=10,font='Helvetica 20 bold')
#-----Cajas de texto-----
CuadroU = Entry(VU,font='Helvetica 20 bold', width=14,textvariable=miU)
CuadroU.place(x=290, y=440)
CuadroC = Entry(VU, font='Helvetica 20 bold', width=14,textvariable=miContra)
CuadroC.place(x=290, y=500)
CuadroC.config(show="*")
def cerrarVU():
VU.destroy()
#----------------------Botones---------
botonR = Button(VU, text="Registrarse", command=cerrarVU)
botonR.place(x=180, y=590)
botonR.config(width=12, height=2, font='Helvetica 10 bold', relief=RIDGE)
botonC = Button(VU, text="Continuar",command=Continuar)
botonC.place(x=350,y=590)
botonC.config(width=12, height=2, font='Helvetica 10 bold', relief=RIDGE)
#Logo Usuario
img = PhotoImage(file="LogoUP.png")
botonIm = Button(VU, image=img,width=400, height=400,relief=FLAT, command=PreL, bg='black').place(x=118,y=10)
VU.mainloop()
#---------------------------------------------------------------------
Y esta es mi base de Datos que cree en otro archivo de python:
1
2
3
4
5
6
7
8
9
10
11
12
13
def BaseRegistroU():
Conexion = sqlite3.connect("Base Registro_de_Usuario")
miCursor = Conexion.cursor()
try:
miCursor.execute('''
CREATE TABLE DATOS_USUARIO (
Usuario VARCHAR(50),
Departamento VARCHAR(50),
TipoU VARCHAR(50),
Contra VARCHAR(50))
''')
messagebox.showinfo("AVISO", "La Base de datos fue creada")
Valora esta pregunta


0