diff --git a/CHANGES b/CHANGES
index 206bfef18aebd04ef60515e71e76e29c650c0bbe..d9fe51233f9784b9e62cd5eb6eb38296c372177a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,8 @@ OpenLDAP 2.4.12 Engineering
 	Fixed slapd-meta quarantine behavior (ITS#5592)
 	Fixed slapo-constraint string termination (ITS#5609)
 	Fixed slapo-rwm callback cleanup (ITS#5601)
+	Build Environment
+		Fixed ODBC library detection (ITS#5602)
 
 OpenLDAP 2.4.11 Release (2008/07/16)
 	Fixed liblber ber_get_next length decoding (ITS#5580)
diff --git a/configure b/configure
index 34452ccdce7ff40bed1f4cea86d8c44d77a4fa47..c722177a1429a81d31de4612e3822afaf2169672 100755
--- a/configure
+++ b/configure
@@ -1085,7 +1085,7 @@ Optional Packages:
   --with-tls		  with TLS/SSL support auto|openssl|gnutls [auto]
   --with-yielding-select  with implicitly yielding select [auto]
   --with-mp               with multiple precision statistics auto|longlong|long|bignum|gmp [auto]
-  --with-odbc             with specific ODBC support iodbc|unixodbc|auto [auto]
+  --with-odbc             with specific ODBC support iodbc|unixodbc|odbc32|auto [auto]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
@@ -2455,7 +2455,7 @@ if test "${with_odbc+set}" = set; then
   withval="$with_odbc"
 
 	ol_arg=invalid
-	for ol_val in auto iodbc unixodbc  ; do
+	for ol_val in auto iodbc unixodbc odbc32  ; do
 		if test "$withval" = "$ol_val" ; then
 			ol_arg="$ol_val"
 		fi
@@ -31915,7 +31915,7 @@ done
 	LIBS="$LTHREAD_LIBS"
 
 	if test $ol_with_odbc = auto ; then
-		ol_with_odbc="iodbc unixodbc"
+		ol_with_odbc="iodbc unixodbc odbc32"
 	fi
 
 	for odbc in $ol_with_odbc ; do
@@ -32073,6 +32073,82 @@ fi
 				fi
 				;;
 
+			odbc32)
+				echo "$as_me:$LINENO: checking for SQLDriverConnect in -lodbc32" >&5
+echo $ECHO_N "checking for SQLDriverConnect in -lodbc32... $ECHO_C" >&6
+if test "${ac_cv_lib_odbc32_SQLDriverConnect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lodbc32  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char SQLDriverConnect ();
+int
+main ()
+{
+SQLDriverConnect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_odbc32_SQLDriverConnect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_odbc32_SQLDriverConnect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_odbc32_SQLDriverConnect" >&5
+echo "${ECHO_T}$ac_cv_lib_odbc32_SQLDriverConnect" >&6
+if test $ac_cv_lib_odbc32_SQLDriverConnect = yes; then
+  have_odbc32=yes
+else
+  have_odbc32=no
+fi
+
+				if test $have_odbc32 = yes ; then
+					ol_link_sql="-lodbc32"
+				fi
+				;;
+
 			*)
 				{ { echo "$as_me:$LINENO: error: unknown ODBC library" >&5
 echo "$as_me: error: unknown ODBC library" >&2;}
diff --git a/configure.in b/configure.in
index e2c76ddfbbe80790f973ace6e2bd53c39ed356da..e2a5166124cea14eb549d973731945521a6d3fe2 100644
--- a/configure.in
+++ b/configure.in
@@ -253,8 +253,8 @@ OL_ARG_WITH(mp,
 	[  --with-mp               with multiple precision statistics auto|longlong|long|bignum|gmp],
 	auto, [auto longlong long bignum gmp yes no])
 OL_ARG_WITH(odbc,
-	[  --with-odbc             with specific ODBC support iodbc|unixodbc|auto],
-	auto, [auto iodbc unixodbc] )
+	[  --with-odbc             with specific ODBC support iodbc|unixodbc|odbc32|auto],
+	auto, [auto iodbc unixodbc odbc32] )
 
 dnl ----------------------------------------------------------------
 dnl Server options
@@ -1929,7 +1929,7 @@ if test $ol_enable_sql != no ; then
 	LIBS="$LTHREAD_LIBS"
 
 	if test $ol_with_odbc = auto ; then
-		ol_with_odbc="iodbc unixodbc"
+		ol_with_odbc="iodbc unixodbc odbc32"
 	fi
 
 	for odbc in $ol_with_odbc ; do
@@ -1949,6 +1949,13 @@ if test $ol_enable_sql != no ; then
 				fi
 				;;
 
+			odbc32)
+				AC_CHECK_LIB(odbc32, SQLDriverConnect, [have_odbc32=yes], [have_odbc32=no])
+				if test $have_odbc32 = yes ; then
+					ol_link_sql="-lodbc32"
+				fi
+				;;
+
 			*)
 				AC_MSG_ERROR([unknown ODBC library])
 				;;