Skip to content

Commit 2080911

Browse files
committed
fix loading path for mssql-auth DLL
1 parent c59afbe commit 2080911

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

mssql_python/pybind/ddbc_bindings.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,16 @@ std::wstring LoadDriverOrThrowException(const std::wstring& modulePath = L"") {
292292
archDir = L"x86";
293293
}
294294
dllDir += archDir;
295+
std::wstring mssqlauthDllPath = dllDir + L"\\mssql-auth.dll";
295296
dllDir += L"\\msodbcsql18.dll";
296297

297298
// Preload mssql-auth.dll from the same path if available
298299
// TODO: Only load mssql-auth.dll if using Entra ID Authentication modes (Active Directory modes)
299-
std::wstring authDllDir = dllDir + L"\\mssql-auth.dll";
300-
HMODULE hAuthModule = LoadLibraryW(authDllDir.c_str());
300+
HMODULE hAuthModule = LoadLibraryW(mssqlauthDllPath.c_str());
301301
if (hAuthModule) {
302-
LOG("Authentication library loaded successfully from - {}", authDllDir.c_str());
302+
LOG("Authentication library loaded successfully from - {}", mssqlauthDllPath.c_str());
303303
} else {
304-
LOG("Note: Authentication library not found at - {}. This is OK if you're not using Entra ID Authentication.", authDllDir.c_str());
304+
LOG("Note: Authentication library not found at - {}. This is OK if you're not using Entra ID Authentication.", mssqlauthDllPath.c_str());
305305
}
306306

307307
// Convert wstring to string for logging

0 commit comments

Comments
 (0)