]> git.saurik.com Git - wxWidgets.git/commitdiff
ODBC updates (it almost works now)
authorRobert Roebling <robert@roebling.de>
Sat, 9 Jan 1999 10:42:08 +0000 (10:42 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 9 Jan 1999 10:42:08 +0000 (10:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/db.h
src/common/db.cpp
src/gtk.inc
src/iodbc/itrace.h
src/iodbc/misc.c

index 2f4260bcf81037f3d7822989ce5bcac105c34f7d..bb718ba3bb295bcf49d0cf12a724d4a9ee9e1e4c 100644 (file)
@@ -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
index 22ea1a380e646a1d3e532317826926e2d61ac89a..0096ce8eb33735d44b8b0b665fc51e6ed4d65a3c 100644 (file)
@@ -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)
index 694d82c24320c607d6496a9e6a5ac6d717129081..07acc7f521659cd56934b2c4c8d599d4e9543c6e 100644 (file)
@@ -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 \
index f932dcc746e2fe5f1c64f647cca524ca918cf728..4c84a4caf1eb08b8f569fe48def0ef0bf95bfe40 100644 (file)
@@ -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
index 42b26a62b92a1b7fea43cafaa9eccaba190f8df7..4535ecd892537d6cfc5f67df35e43597c86a2cbb 100644 (file)
@@ -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