diff --git a/ChangeLog b/ChangeLog index a32f4c9..30e5908 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Oct 16 09:19:16 CDT 2004 Jeff Smith + * INSTALL: + * README: + * configure.in: + * include/mdbodbc.h: + * src/odbc/connectparams.c: + * src/odbc/odbc.c: Get ODBC driver to work for iODBC + Fri Sep 24 00:07:10 CDT 2004 Jeff Smith * doc/install.sgml: Document odbcinst.ini entry diff --git a/INSTALL b/INSTALL index 8ff6497..aca6a0f 100644 --- a/INSTALL +++ b/INSTALL @@ -41,12 +41,15 @@ Installation Options ==================== configure can be passed any of the following flags to turn on other -capabilities. +capabilities. Note that the options --with-unixodbc and --with-iodbc are +mutually exclusive. --enable-sql will cause the SQL engine to be built, you must have flex and bison (or yacc) installed for this option. --with-unixodbc specifies the location of the unixODBC driver manager and - causes the ODBC driver to be built. + causes the unixODBC driver to be built. +--with-iodbc specifies the location of the iODBC driver manager and + causes the iODBC driver to be built. Installation from CVS Sources diff --git a/README b/README index 92979eb..4c7845a 100644 --- a/README +++ b/README @@ -10,8 +10,8 @@ pieces are: and data, show the version of the files, and other useful stuff. . mdb-sql - a command line SQL tool that allows one to type sql queries and get results. -. odbc - An ODBC driver for use with unixODBC driver manager. Allows - one to use MDB files with PHP for example. +. odbc - An ODBC driver for use with unixODBC or iODBC driver manager. + Allows one to use MDB files with PHP for example. . gmdb2 - The Gnome MDB File Viewer and debugger. Still alpha, but making great progress. diff --git a/configure.in b/configure.in index 05428d5..c478280 100644 --- a/configure.in +++ b/configure.in @@ -60,6 +60,14 @@ if test "$with_iodbc"; then ODBC_CFLAGS="-I$with_iodbc/include" ODBC_LIBS="-L$with_iodbc/lib" CFLAGS="$CFLAGS -DIODBC" + + OLDLDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $ODBC_LIBS" + AC_CHECK_LIB(iodbcinst, SQLGetPrivateProfileString, + [ODBC_LIBS="$ODBC_LIBS -liodbcinst" + AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1, + [Define to 1 if you have the SQLGetPrivateProfileString function.])]) + LDFLAGS=$OLDLDFLAGS fi dnl check for unixODBC @@ -70,6 +78,14 @@ if test "$with_unixodbc"; then ODBC_CFLAGS="-I$with_unixodbc/include" ODBC_LIBS="-L$with_unixodbc/lib" CFLAGS="$CFLAGS -DUNIXODBC" + + OLDLDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $ODBC_LIBS" + AC_CHECK_LIB(odbcinst, SQLGetPrivateProfileString, + [ODBC_LIBS="$ODBC_LIBS -lodbcinst" + AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1, + [Define to 1 if you have the SQLGetPrivateProfileString function.])]) + LDFLAGS=$OLDLDFLAGS fi if test "x$HAVE_ODBC" = "xtrue"; then @@ -79,12 +95,6 @@ if test "x$HAVE_ODBC" = "xtrue"; then exit 1 fi - OLDLDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $ODBC_LIBS" - AC_CHECK_LIB(odbcinst, SQLGetPrivateProfileString, [ODBC_LIBS="$ODBC_LIBS -lodbcinst" - AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1, [Define to 1 if you have the SQLGetPrivateProfileString function.])]) - LDFLAGS=$OLDLDFLAGS - AC_SUBST(ODBC_CFLAGS) AC_SUBST(ODBC_LIBS) OPTDIRS="$OPTDIRS odbc" diff --git a/include/mdbodbc.h b/include/mdbodbc.h index bd061bc..0a83078 100644 --- a/include/mdbodbc.h +++ b/include/mdbodbc.h @@ -22,16 +22,12 @@ #include #include -#ifdef UNIXODBC #include #include -#include -#elif defined(MDB_NO_DM) -#include -#include -#else /* IODBC */ -#include "isql.h" -#include "isqlext.h" +#if defined(UNIXODBC) +# include +#elif defined(IODBC) +# include #endif @@ -40,7 +36,7 @@ extern "C" { #endif static char rcsid_sql_h [ ] = - "$Id: mdbodbc.h,v 1.3 2004/03/04 21:25:09 brianb Exp $"; + "$Id: mdbodbc.h,v 1.4 2004/10/16 14:21:15 whydoubt Exp $"; static void *no_unused_sql_h_warn[]={rcsid_sql_h, no_unused_sql_h_warn}; struct _henv { diff --git a/src/odbc/connectparams.c b/src/odbc/connectparams.c index d59ff01..a44d73e 100644 --- a/src/odbc/connectparams.c +++ b/src/odbc/connectparams.c @@ -93,7 +93,7 @@ void FreeConnectParams (ConnectParams* params) } #if !HAVE_SQLGETPRIVATEPROFILESTRING -int LoadDSN ( +static int LoadDSN ( const gchar* iniFileName, const gchar* dsnName, GHashTable* table) { FILE* stream; @@ -500,6 +500,7 @@ static gboolean cleanup (gpointer key, gpointer value, gpointer user_data) #define ODBCINST_PROMPTTYPE_COMBOBOX 3 #define ODBCINST_PROMPTTYPE_FILENAME 4 #define ODBCINST_PROMPTTYPE_HIDDEN 5 +#define ODBCINST_PROMPTTYPE_TEXTEDIT_PASSWORD 6 typedef struct tODBCINSTPROPERTY { diff --git a/src/odbc/odbc.c b/src/odbc/odbc.c index a853349..3fc15ff 100644 --- a/src/odbc/odbc.c +++ b/src/odbc/odbc.c @@ -17,13 +17,8 @@ * Boston, MA 02111-1307, USA. */ -#ifdef UNIXODBC #include #include -#else -#include "isql.h" -#include "isqlext.h" -#endif #include @@ -32,7 +27,7 @@ #include "connectparams.h" -static char software_version[] = "$Id: odbc.c,v 1.24 2004/09/23 05:07:12 whydoubt Exp $"; +static char software_version[] = "$Id: odbc.c,v 1.25 2004/10/16 14:21:16 whydoubt Exp $"; static void *no_unused_var_warn[] = {software_version, no_unused_var_warn};