From 9cf4e24d24b25c973cd27a621171b3486b9afdc2 Mon Sep 17 00:00:00 2001 From: kommih Date: Mon, 23 Apr 2018 19:14:07 +1000 Subject: [PATCH] Initialize the RegisterDSN default values first and then replace them with provided connection string attributes --- setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index 0d8a8a7..66551fa 100644 --- a/setup.c +++ b/setup.c @@ -118,8 +118,6 @@ ConfigDSN(HWND hwnd, } else if (lpsetupdlg->ci.dsn[0]) { - MYLOG(0, "about to getCiAllDefaults\n"); - getCiAllDefaults(&lpsetupdlg->ci); fSuccess = SetDSNAttributes(hwnd, lpsetupdlg, NULL); } else @@ -581,6 +579,10 @@ ParseAttributes(LPCSTR lpszAttributes, LPSETUPDLG lpsetupdlg) CC_conninfo_init(&(lpsetupdlg->ci), INIT_GLOBALS); + /* Initialize defaults and replace it with attribute string */ + MYLOG(0, "about to getCiAllDefaults\n"); + getCiAllDefaults(&lpsetupdlg->ci); + for (lpsz = lpszAttributes; *lpsz; lpsz++) { /* -- 2.16.1.windows.4