X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a327b520909bea498517e512ddfdee0a052fe876..878711c01c1b9ad5b97d35f379a048b8ce1bfb49:/src/common/db.cpp diff --git a/src/common/db.cpp b/src/common/db.cpp index 15160d5951..08c40f003d 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -562,7 +562,8 @@ const wxChar *wxDb::convertUserID(const wxChar *userID, wxString &UserID) UserID.Empty(); // dBase does not use user names, and some drivers fail if you try to pass one - if (Dbms() == dbmsDBASE) + if ( Dbms() == dbmsDBASE + || Dbms() == dbmsXBASE_SEQUITER ) UserID.Empty(); // Oracle user names may only be in uppercase, so force @@ -3498,6 +3499,9 @@ wxDBMS wxDb::Dbms(void) if (!wxStricmp(baseName,wxT("DBASE"))) return((wxDBMS)(dbmsType = dbmsDBASE)); + if (!wxStricmp(baseName,wxT("xBase"))) + return((wxDBMS)(dbmsType = dbmsXBASE_SEQUITER)); + if (!wxStricmp(baseName,wxT("MySQL"))) return((wxDBMS)(dbmsType = dbmsMY_SQL)); @@ -3565,14 +3569,23 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, case dbmsPOSTGRES : case dbmsACCESS : case dbmsDBASE : + case dbmsXBASE_SEQUITER : default : alterSlashModify = "MODIFY"; break; } // create the SQL statement - sqlStmt.Printf(wxT("ALTER TABLE \"%s\" \"%s\" \"%s\" %s"), tableName.c_str(), alterSlashModify.c_str(), + if ( Dbms() == dbmsMY_SQL ) + { + sqlStmt.Printf(wxT("ALTER TABLE %s %s %s %s"), tableName.c_str(), alterSlashModify.c_str(), columnName.c_str(), dataTypeName.c_str()); + } + else + { + sqlStmt.Printf(wxT("ALTER TABLE \"%s\" \"%s\" \"%s\" %s"), tableName.c_str(), alterSlashModify.c_str(), + columnName.c_str(), dataTypeName.c_str()); + } // For varchars only, append the size of the column if (dataType == DB_DATA_TYPE_VARCHAR && @@ -3745,7 +3758,7 @@ int WXDLLEXPORT wxDbConnectionsInUse(void) /********** wxDbLogExtendedErrorMsg() **********/ // DEBUG ONLY function -const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText, +const wxChar* WXDLLEXPORT wxDbLogExtendedErrorMsg(const wxChar *userText, wxDb *pDb, const wxChar *ErrFile, int ErrLine)