projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
initialize ICONINFO to avoid Purify warnings
[wxWidgets.git]
/
src
/
common
/
db.cpp
diff --git
a/src/common/db.cpp
b/src/common/db.cpp
index 15160d59514e31454a27b222fbc636ce1c8a69f4..6f0e8dce249569807621cdbefe2238c92ce2b602 100644
(file)
--- a/
src/common/db.cpp
+++ b/
src/common/db.cpp
@@
-53,9
+53,6
@@
#include "wx/object.h"
#include "wx/list.h"
#include "wx/utils.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/utils.h"
- #if wxUSE_GUI
- #include "wx/msgdlg.h"
- #endif
#include "wx/log.h"
#endif
#include "wx/filefn.h"
#include "wx/log.h"
#endif
#include "wx/filefn.h"
@@
-562,7
+559,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
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
UserID.Empty();
// Oracle user names may only be in uppercase, so force
@@
-3066,7
+3064,7
@@
bool wxDb::Catalog(const wxChar *userID, const wxString &fileName)
GetData(7,SQL_C_SLONG, (UCHAR *)&precision, 0, &cb);
GetData(8,SQL_C_SLONG, (UCHAR *)&length, 0, &cb);
GetData(7,SQL_C_SLONG, (UCHAR *)&precision, 0, &cb);
GetData(8,SQL_C_SLONG, (UCHAR *)&length, 0, &cb);
- outStr.Printf(wxT("%-32s %-32s (%04d)%-15s %9
d %9
d\n"),
+ outStr.Printf(wxT("%-32s %-32s (%04d)%-15s %9
ld %9l
d\n"),
tblName, colName, sqlDataType, typeName, precision, length);
if (fputs(outStr.c_str(), fp) == EOF)
{
tblName, colName, sqlDataType, typeName, precision, length);
if (fputs(outStr.c_str(), fp) == EOF)
{
@@
-3498,6
+3496,9
@@
wxDBMS wxDb::Dbms(void)
if (!wxStricmp(baseName,wxT("DBASE")))
return((wxDBMS)(dbmsType = dbmsDBASE));
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));
if (!wxStricmp(baseName,wxT("MySQL")))
return((wxDBMS)(dbmsType = dbmsMY_SQL));
@@
-3565,21
+3566,30
@@
bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName,
case dbmsPOSTGRES :
case dbmsACCESS :
case dbmsDBASE :
case dbmsPOSTGRES :
case dbmsACCESS :
case dbmsDBASE :
+ case dbmsXBASE_SEQUITER :
default :
alterSlashModify = "MODIFY";
break;
}
// create the SQL statement
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());
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 &&
(Dbms() != dbmsMY_SQL || dataTypeName != "text"))
{
wxString s;
// For varchars only, append the size of the column
if (dataType == DB_DATA_TYPE_VARCHAR &&
(Dbms() != dbmsMY_SQL || dataTypeName != "text"))
{
wxString s;
- s.Printf(wxT("(%
d
)"), columnLength);
+ s.Printf(wxT("(%
lu
)"), columnLength);
sqlStmt += s;
}
sqlStmt += s;
}
@@
-3745,7
+3755,7
@@
int WXDLLEXPORT wxDbConnectionsInUse(void)
/********** wxDbLogExtendedErrorMsg() **********/
// DEBUG ONLY function
/********** 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)
wxDb *pDb,
const wxChar *ErrFile,
int ErrLine)