diff --git a/__pycache__/inexConnect.cpython-312.pyc b/__pycache__/inexConnect.cpython-312.pyc index 24e88c9..c97f32b 100644 Binary files a/__pycache__/inexConnect.cpython-312.pyc and b/__pycache__/inexConnect.cpython-312.pyc differ diff --git a/inexConnect.py b/inexConnect.py index 5925272..b87a05a 100644 --- a/inexConnect.py +++ b/inexConnect.py @@ -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() diff --git a/test.py b/test.py new file mode 100644 index 0000000..1d193f6 --- /dev/null +++ b/test.py @@ -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") \ No newline at end of file