])
fi
+if test -z "$ODBC_TYPE"; then
+AC_MSG_CHECKING(for ODBCRouter.com support)
+AC_ARG_WITH(ODBCRouter,
+[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support. DIR is ODBCRouter base
+ install directory, defaults to /usr.],
+[
+ PHP_WITH_SHARED
+ if test "$withval" = "yes"; then
+ withval=/usr
+ fi
+ if test "$withval" != "no"; then
+ ODBC_INCDIR=$withval/include
+ ODBC_LIBDIR=$withval/lib
+ ODBC_LFLAGS=-L$ODBC_LIBDIR
+ ODBC_INCLUDE=-I$ODBC_INCDIR
+ ODBC_LIBS=-lodbcsdk
+ ODBC_TYPE=ODBCRouter
+ AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ])
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+],[
+ AC_MSG_RESULT(no)
+])
+fi
+
if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for Empress support)
AC_ARG_WITH(empress,
SQLSetConnectOption((*conn)->hdbc, SQL_TRANSLATE_OPTION,
SQL_SOLID_XLATOPT_NOCNV);
#endif
+#ifdef HAVE_ODBC_ROUTER
+ {
+#define CONNSTRSIZE 2048
+ char *lpszConnStr = emalloc(CONNSTRSIZE);
+ if (lpszConnStr && db) {
+ short cbszConnStr;
+ if (strstr(db, ";")) {
+ /* the caller has apparently passed a connection-string */
+ if (strstr(db, "uid") || strstr(db, "UID")) {
+ uid = NULL;
+ }
+ if (strstr(db, "pwd") || strstr(db, "PWD")) {
+ pwd = NULL;
+ }
+ strncpy( lpszConnStr, db, CONNSTRSIZE);
+ }
+ else {
+ strcpy(lpszConnStr, "DSN=");
+ strcat(lpszConnStr, db);
+ }
+ if (uid) {
+ if (uid[0]) {
+ strcat(lpszConnStr, ";UID=");
+ strcat(lpszConnStr, uid);
+ strcat(lpszConnStr, ";");
+ }
+ if (pwd) {
+ if (pwd[0]) {
+ strcat(lpszConnStr, "PWD=");
+ strcat(lpszConnStr, pwd);
+ strcat(lpszConnStr, ";");
+ }
+ }
+ }
+ rc = SQLDriverConnect((*conn)->hdbc, NULL, lpszConnStr, SQL_NTS,
+ lpszConnStr, CONNSTRSIZE, &cbszConnStr,
+ SQL_DRIVER_NOPROMPT);
+ efree(lpszConnStr);
+ }
+ }
+#else
#ifdef HAVE_OPENLINK
{
char dsnbuf[1024];
#else
rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);
#endif
+#endif
#endif
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
odbc_sql_error(*conn, SQL_NULL_HSTMT, "SQLConnect");