X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01dba85a7fc9a1103f866c7c3a5cc72f21c0784e..a8a32ce2cf162a218683c3708109ab58884717b7:/src/common/db.cpp diff --git a/src/common/db.cpp b/src/common/db.cpp index 3842b2cb11..5e34839f63 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -63,6 +63,7 @@ #include "wx/msgdlg.h" #endif #include "wx/filefn.h" + #include "wx/wxchar.h" #endif #if wxMAJOR_VERSION == 1 @@ -91,10 +92,23 @@ DbList WXDLLEXPORT *PtrBegDbList = 0; -#if __WXDEBUG__ > 0 +#ifdef __WXDEBUG__ extern wxList TablesInUse; #endif + +#ifdef __MWERKS__ +#ifdef __WXMSW__ +#define stricmp _stricmp +#define strnicmp _strnicmp +#else //__WXMSW_ +int strcasecmp(const char *str_1, const char *str_2) ; +int strncasecmp(const char *str_1, const char *str_2, size_t maxchar) ; +#define stricmp strcasecmp +#define strnicmp strncasecmp +#endif +#endif //__MWERKS__ + // SQL Log defaults to be used by GetDbConnection enum sqlLog SQLLOGstate = sqlLogOFF; @@ -177,7 +191,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. @@ -762,7 +776,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(); @@ -1706,7 +1720,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); @@ -1720,7 +1739,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);