-
Notifications
You must be signed in to change notification settings - Fork 0
/
ventana.py
67 lines (40 loc) · 1.01 KB
/
ventana.py
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
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 15:58:05 2020
@author: Ravelo
"""
import tkinter as tk
import pyodbc as bd
#for driver in bd.drivers():
# print(driver)
conn = bd.connect(
"Driver={ODBC Driver 17 for SQL Server};"
"Server={CONSULTORIA\SQLDEV2017};"
"Database={LIBERTYcarsANUALDB};"
"uid='ADMIN;" " pwd=SOPORTE;")
# "Trusted_Connection=yes;")
'''
estable=bd.Connection()
print (estable)
'''
def read(conn):
print("lectura")
cursor=conn.cursor()
cursor.execute("select * from ssusua")
for linea in cursor:
print(f'linea={linea}')
print()
if cursor == True:
print("Conexion establecida correctamente")
else:
print("Parametros errados, conexion falla!")
#read(conn)
#cursor.close()
conn.close()
print ("conexion cerrada")
#ventana=tk.Tk()
#ventana.title("Saint Concesionarios")
#ventana.geometry('640x480')
#etiqueta=tk.Label(ventana,text="menu principal",bg="blue", fg="black")
#etiqueta.pack()
#ventana.mainloop()