From: Robert Roebling Date: Sat, 9 Jan 1999 10:42:08 +0000 (+0000) Subject: ODBC updates (it almost works now) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1acd7ba6f2ffc10369ed74a2ac4d8a28eadf1151 ODBC updates (it almost works now) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/db.h b/include/wx/db.h index 2f4260bcf8..bb718ba3bb 100644 --- a/include/wx/db.h +++ b/include/wx/db.h @@ -263,12 +263,12 @@ public: struct { char dbmsName[40]; // Name of the dbms product - char dbmsVer[20]; // Version # of the dbms product + char dbmsVer[40]; // Version # of the dbms product char driverName[40]; // Driver name - char odbcVer[20]; // ODBC version of the driver - char drvMgrOdbcVer[20]; // ODBC version of the driver manager - char driverVer[40]; // Driver version - char serverName[40]; // Server Name, typically a connect string + char odbcVer[60]; // ODBC version of the driver + char drvMgrOdbcVer[60]; // ODBC version of the driver manager + char driverVer[60]; // Driver version + char serverName[80]; // Server Name, typically a connect string char databaseName[128]; // Database filename char outerJoins[2]; // Indicates whether the data source supports outer joins char procedureSupport[2]; // Indicates whether the data source supports stored procedures diff --git a/src/common/db.cpp b/src/common/db.cpp index 22ea1a380e..0096ce8eb3 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -319,7 +319,7 @@ bool wxDB::getDbInfo(void) if (SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR*) dbInf.dbmsName, 40, &cb) != SQL_SUCCESS) return(DispAllErrors(henv, hdbc)); - if (SQLGetInfo(hdbc, SQL_DBMS_VER, (UCHAR*) dbInf.dbmsVer, 20, &cb) != SQL_SUCCESS) + if (SQLGetInfo(hdbc, SQL_DBMS_VER, (UCHAR*) dbInf.dbmsVer, 40, &cb) != SQL_SUCCESS) return(DispAllErrors(henv, hdbc)); if (SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, (UCHAR*) &dbInf.maxConnections, sizeof(dbInf.maxConnections), &cb) != SQL_SUCCESS) @@ -331,13 +331,13 @@ bool wxDB::getDbInfo(void) if (SQLGetInfo(hdbc, SQL_DRIVER_NAME, (UCHAR*) dbInf.driverName, 40, &cb) != SQL_SUCCESS) return(DispAllErrors(henv, hdbc)); - if (SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 20, &cb) != SQL_SUCCESS) + if (SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 60, &cb) == SQL_ERROR) return(DispAllErrors(henv, hdbc)); - if (SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 20, &cb) != SQL_SUCCESS) + if (SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 60, &cb) == SQL_ERROR) return(DispAllErrors(henv, hdbc)); - if (SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 40, &cb) != SQL_SUCCESS) + if (SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 60, &cb) == SQL_ERROR) return(DispAllErrors(henv, hdbc)); if (SQLGetInfo(hdbc, SQL_ODBC_API_CONFORMANCE, (UCHAR*) &dbInf.apiConfLvl, sizeof(dbInf.apiConfLvl), &cb) != SQL_SUCCESS) diff --git a/src/gtk.inc b/src/gtk.inc index 694d82c243..07acc7f521 100644 --- a/src/gtk.inc +++ b/src/gtk.inc @@ -35,7 +35,8 @@ LIB_CPP_SRC=\ common/memory.cpp \ common/module.cpp \ common/object.cpp \ - common/odbc.cpp \ + common/db.cpp \ + common/dbtable.cpp \ common/postscrp.cpp \ common/prntbase.cpp \ common/serbase.cpp \ diff --git a/src/iodbc/itrace.h b/src/iodbc/itrace.h index f932dcc746..4c84a4caf1 100644 --- a/src/iodbc/itrace.h +++ b/src/iodbc/itrace.h @@ -7,6 +7,12 @@ # endif # endif +/* never trace, Robert Roebling */ + +#ifndef NO_TRACE +#define NO_TRACE +#endif + # define TRACE_TYPE_APP2DM 1 # define TRACE_TYPE_DM2DRV 2 # define TRACE_TYPE_DRV2DM 3 diff --git a/src/iodbc/misc.c b/src/iodbc/misc.c index 42b26a62b9..4535ecd892 100644 --- a/src/iodbc/misc.c +++ b/src/iodbc/misc.c @@ -122,7 +122,7 @@ getinitfile(char* buf, int size) int i, j; char* ptr; - j = STRLEN("/iodbc.ini") + 1; + j = STRLEN("/odbc.ini") + 1; if( size < j ) { @@ -130,13 +130,13 @@ getinitfile(char* buf, int size) } #ifdef FIX_INI_FILE - sprintf( buf, "%s/iodbc.ini", DIR_INI_FILE ); + sprintf( buf, "%s/odbc.ini", DIR_INI_FILE ); #else # ifdef OS2 *buf = '\0'; - if( NULL != getenv("IODBC_INI") ) + if( NULL != getenv("ODBC_INI") ) { - strcpy( buf, getenv("IODBC_INI") ); + strcpy( buf, getenv("ODBC_INI") ); } else { @@ -151,7 +151,7 @@ getinitfile(char* buf, int size) } else { - strcpy( buf, "iodbc.ini" ); + strcpy( buf, "odbc.ini" ); } } @@ -166,7 +166,7 @@ getinitfile(char* buf, int size) return NULL; } - sprintf( buf + i, "/iodbc.ini"); + sprintf( buf + i, "/odbc.ini"); return buf; # else @@ -189,8 +189,8 @@ getinitfile(char* buf, int size) return NULL; } - sprintf( buf, "%s%s", ptr, "/.iodbc.ini"); - /* i.e. searching ~/.iodbc.ini */ + sprintf( buf, "%s%s", ptr, "/.odbc.ini"); + /* i.e. searching ~/.odbc.ini */ # endif # endif #endif