]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/db.cpp
Added wxWakeUpIdle() for MSW and empty stubs for Motif, OS2, and Mac
[wxWidgets.git] / src / common / db.cpp
index 2cb97f65b243f73ecd99053f2f11156da60d9afc..c9a7b9ae632ed395c15616cdd30a44e6cb54882d 100644 (file)
 // SYNOPSIS STOP
 */
 
+#include "wx/wxprec.h"
+
 // Use this line for wxWindows v1.x
 //#include "wx_ver.h"
 // Use this line for wxWindows v2.x
 #include "wx/version.h"
-#include "wx/wxprec.h"
 
 #if wxMAJOR_VERSION == 2
        #ifdef __GNUG__
@@ -62,6 +63,7 @@
                 #include "wx/msgdlg.h"
        #endif
        #include "wx/filefn.h"
+       #include "wx/wxchar.h"
 #endif
 
 #if wxMAJOR_VERSION == 1
 
 DbList WXDLLEXPORT *PtrBegDbList = 0;
 
-#if __WXDEBUG__ > 0
+#ifdef __WXDEBUG__
        extern wxList TablesInUse;
 #endif
 
+
 // SQL Log defaults to be used by GetDbConnection
 enum sqlLog SQLLOGstate                                = sqlLogOFF;
 
@@ -176,7 +179,7 @@ bool wxDB::Open(char *Dsn, char *Uid, char *AuthStr)
 
        RETCODE retcode;
 
-#if wxODBC_FWD_ONLY_CURSORS
+#if !wxODBC_FWD_ONLY_CURSORS
 
        // Specify that the ODBC cursor library be used, if needed.  This must be
        // specified before the connection is made.
@@ -761,7 +764,7 @@ void wxDB::Close(void)
        // There should be zero Ctable objects still connected to this db object
        assert(nTables == 0);
 
-#if __WXDEBUG__ > 0
+#ifdef __WXDEBUG__
        CstructTablesInUse *tiu;
        wxNode *pNode;
        pNode = TablesInUse.First();
@@ -1705,7 +1708,12 @@ bool wxDB::WriteSqlLog(char *logMsg)
  */
 DBMS wxDB::Dbms(void)
 {
-       if (!wxStrnicmp(dbInf.dbmsName,"Oracle",6))
+       wxChar baseName[20];
+
+       wxStrncpy(baseName,dbInf.dbmsName,6);
+       baseName[6] = 0;
+//     if (!wxStrnicmp(dbInf.dbmsName,"Oracle",6))
+       if (!wxStricmp(baseName,"Oracle"))
                return(dbmsORACLE);
        if (!wxStricmp(dbInf.dbmsName,"Adaptive Server Anywhere"))
                return(dbmsSYBASE_ASA);
@@ -1719,7 +1727,10 @@ DBMS wxDB::Dbms(void)
                return(dbmsPOSTGRES);
        if (!wxStricmp(dbInf.dbmsName,"ACCESS"))
                return(dbmsACCESS);
-       if (!wxStrnicmp(dbInf.dbmsName,"DBASE",5))
+       wxStrncpy(baseName,dbInf.dbmsName,5);
+       baseName[5] = 0;
+//     if (!wxStrnicmp(dbInf.dbmsName,"DBASE",5))
+       if (!wxStricmp(baseName,"DBASE"))
                return(dbmsDBASE);
        return(dbmsUNIDENTIFIED);