removed hardcoded driver and set to read from toml
This commit is contained in:
parent
3faa88cd90
commit
288fd762f6
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
def connectDatabase(lib, driver, server, database, user, password):
|
||||
connectionString = f'DRIVER={{ODBC Driver 18 for SQL Server}};SERVER={server};DATABASE={database};UID={user};PWD={password};TrustServerCertificate=yes'
|
||||
connectionString = f'DRIVER={{{driver}}};SERVER={server};DATABASE={database};UID={user};PWD={password};TrustServerCertificate=yes'
|
||||
print(connectionString)
|
||||
connection = lib.connect(connectionString)
|
||||
cursor = connection.cursor()
|
||||
|
5
test.py
Normal file
5
test.py
Normal file
@ -0,0 +1,5 @@
|
||||
def connectDatabase(driver, server, database, user, password):
|
||||
connectionString = f'DRIVER={{{driver}}};SERVER={server};DATABASE={database};UID={user};PWD={password};TrustServerCertificate=yes'
|
||||
print(connectionString)
|
||||
|
||||
a = connectDatabase("ODBC Driver 18 for SQL Server","b","c","d","e")
|
Loading…
x
Reference in New Issue
Block a user