initial commit

This commit is contained in:
2026-08-26 21:08:20 +01:00
commit 8d45a2505b
30 changed files with 990 additions and 0 deletions
@@ -0,0 +1,44 @@
import pyodbc
try:
connection = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=.;DATABASE=SampleDB;Trusted_Connection=yes')
cursor = connection.cursor()
print("select before deleteing...")
cursor.execute("select * from tblCustomers")
while 1:
row = cursor.fetchone()
if not row:
break
print(row.id, row.code, row.firstName, row.lastName)
prm_code = "code6"
cursor.execute("delete from tblCustomers where code = ?", prm_code)
connection.commit()
print("select after deleting")
cursor.execute("select * from tblCustomers")
while 1:
row = cursor.fetchone()
if not row:
break
print(row.id, row.code, row.firstName, row.lastName)
cursor.close()
connection.close()
except pyodbc.Error as ex:
print()
print("exception: ",ex)
cursor.close()
connection.close()
print()
exit()
print()