Get ODBC driver to work for iODBC

This commit is contained in:
whydoubt 2004-10-16 14:21:13 +00:00
parent 44fde416d4
commit 26cd3ee1ba
7 changed files with 39 additions and 26 deletions

View File

@ -1,3 +1,11 @@
Sat Oct 16 09:19:16 CDT 2004 Jeff Smith <whydoubt@yahoo.com>
* 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 <whydoubt@yahoo.com>
* doc/install.sgml: Document odbcinst.ini entry

View File

@ -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

4
README
View File

@ -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.

View File

@ -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"

View File

@ -22,16 +22,12 @@
#include <mdbtools.h>
#include <mdbsql.h>
#ifdef UNIXODBC
#include <sql.h>
#include <sqlext.h>
#include <odbcinst.h>
#elif defined(MDB_NO_DM)
#include <sql.h>
#include <sqlext.h>
#else /* IODBC */
#include "isql.h"
#include "isqlext.h"
#if defined(UNIXODBC)
# include <odbcinst.h>
#elif defined(IODBC)
# include <iodbcinst.h>
#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 {

View File

@ -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
{

View File

@ -17,13 +17,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef UNIXODBC
#include <sql.h>
#include <sqlext.h>
#else
#include "isql.h"
#include "isqlext.h"
#endif
#include <mdbodbc.h>
@ -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};