#define SQL_C_BLOB SQL_VARBINARY
#endif
#endif
-
+/*
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
-
+*/
const int wxDB_PATH_MAX = 254;
extern wxChar const *SQL_LOG_FILENAME;
bool DispAllErrors(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT);
bool GetNextError(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT);
void DispNextError(void);
- bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=true);
+ bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=TRUE);
bool DropView(const wxString &viewName);
bool ExecSql(const wxString &pSqlStmt);
bool GetNext(void);
{ logError(errMsg, SQLState); }
void SetDebugErrorMessages(bool state) { silent = !state; }
bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME,
- bool append = false);
+ bool append = FALSE);
bool WriteSqlLog(const wxString &logMsg);
wxDBMS Dbms(void);
#if 0
// MSW/VC6 ONLY!!! Experimental
int WXDLLEXPORT wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description=wxEmptyString,
- bool sysDSN=false, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL);
+ bool sysDSN=FALSE, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL);
#endif
// This routine allows you to query a driver manager
{
public:
wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo *ColInfo,
- int count = wxUSE_QUERY, bool takeOwnership = true);
+ int count = wxUSE_QUERY, bool takeOwnership = TRUE);
~wxDbGridTableBase();
virtual int GetNumberRows()
virtual wxString wxDbGridTableBase::GetColLabelValue(int col);
- virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=true);
+ virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=TRUE);
virtual void ValidateRow(int row);
virtual bool UpdateRow(int row) const
{
if (m_row != row)
- return true;
+ return TRUE;
else
return Writeback();
}
const int wxDB_ROWID_LEN = 24; // 18 is the max, 24 is in case it gets larger
const int wxDB_DEFAULT_CURSOR = 0;
-const bool wxDB_QUERY_ONLY = true;
-const bool wxDB_DISABLE_VIEW = true;
+const bool wxDB_QUERY_ONLY = TRUE;
+const bool wxDB_DISABLE_VIEW = TRUE;
// Used to indicate end of a variable length list of
// column numbers passed to member functions
SWORD SqlCtype; // C data type; e.g. SQL_C_LONG
void *PtrDataObj; // Address of the data object
int SzDataObj; // Size, in bytes, of the data object
- bool KeyField; // true if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields.
+ bool KeyField; // TRUE if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields.
bool Updateable; // Specifies whether this column is updateable
bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement
bool DerivedCol; // Specifies whether this column is a derived value
virtual ~wxDbTable();
- bool Open(bool checkPrivileges=false, bool checkTableExists=true);
- bool CreateTable(bool attemptDrop=true);
+ bool Open(bool checkPrivileges=FALSE, bool checkTableExists=TRUE);
+ bool CreateTable(bool attemptDrop=TRUE);
bool DropTable(void);
bool CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols,
- wxDbIdxDef *pIdxDefs, bool attemptDrop=true);
+ wxDbIdxDef *pIdxDefs, bool attemptDrop=TRUE);
bool DropIndex(const wxString &idxName);
// Accessors
bool Delete(void);
bool DeleteWhere(const wxString &pWhereClause);
bool DeleteMatching(void);
- virtual bool Query(bool forUpdate = false, bool distinct = false);
+ virtual bool Query(bool forUpdate = FALSE, bool distinct = FALSE);
bool QueryBySqlStmt(const wxString &pSqlStmt);
- bool QueryMatching(bool forUpdate = false, bool distinct = false);
- bool QueryOnKeyFields(bool forUpdate = false, bool distinct = false);
+ bool QueryMatching(bool forUpdate = FALSE, bool distinct = FALSE);
+ bool QueryOnKeyFields(bool forUpdate = FALSE, bool distinct = FALSE);
bool Refresh(void);
bool GetNext(void) { return(getRec(SQL_FETCH_NEXT)); }
bool operator++(int) { return(getRec(SQL_FETCH_NEXT)); }
void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxString &pWhereClause="");
void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpd, const wxString &pWhereClause="");
- void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=false);
- void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=false);
+ void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=FALSE);
+ void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=FALSE);
#if wxODBC_BACKWARD_COMPATABILITY
// The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above)
void GetUpdateStmt(char *pSqlStmt, int typeOfUpd, const char *pWhereClause = NULL)
{ BuildUpdateStmt(pSqlStmt,typeOfUpd,pWhereClause); }
void GetWhereClause(char *pWhereClause, int typeOfWhere,
- const char *qualTableName = NULL, bool useLikeComparison=false)
+ const char *qualTableName = NULL, bool useLikeComparison=FALSE)
{ BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); }
#endif
bool CanSelectForUpdate(void);
bool CanUpdByROWID(void);
- void ClearMemberVar(UWORD colNo, bool setToNull=false);
- void ClearMemberVars(bool setToNull=false);
+ void ClearMemberVar(UWORD colNo, bool setToNull=FALSE);
+ void ClearMemberVars(bool setToNull=FALSE);
bool SetQueryTimeout(UDWORD nSeconds);
wxDbColDef *GetColDefs() { return colDefs; }
void SetColDefs(UWORD index, const wxString &fieldName, int dataType,
void *pData, SWORD cType,
- int size, bool keyField = false, bool upd = true,
- bool insAllow = true, bool derivedCol = false);
+ int size, bool keyField = FALSE, bool upd = TRUE,
+ bool insAllow = TRUE, bool derivedCol = FALSE);
wxDbColDataPtr *SetColDefs(wxDbColInf *colInfs, UWORD numCols);
bool CloseCursor(HSTMT cursor);
bool DeleteCursor(HSTMT *hstmtDel);
void SetCursor(HSTMT *hstmtActivate = (void **) wxDB_DEFAULT_CURSOR);
HSTMT GetCursor(void) { return(hstmt); }
- HSTMT *GetNewCursor(bool setCursor = false, bool bindColumns = true);
+ HSTMT *GetNewCursor(bool setCursor = FALSE, bool bindColumns = TRUE);
#if wxODBC_BACKWARD_COMPATABILITY
// The following member function is deprecated. You should use the GetNewCursor
- HSTMT *NewCursor(bool setCursor = false, bool bindColumns = true) { return GetNewCursor(setCursor,bindColumns); }
+ HSTMT *NewCursor(bool setCursor = FALSE, bool bindColumns = TRUE) { return GetNewCursor(setCursor,bindColumns); }
#endif
ULONG Count(const wxString &args="*");
int DB_STATUS(void) { return(pDb->DB_STATUS); }
bool IsColNull(UWORD colNo) const;
- bool SetColNull(UWORD colNo, bool set=true);
- bool SetColNull(const wxString &colName, bool set=true);
+ bool SetColNull(UWORD colNo, bool set=TRUE);
+ bool SetColNull(const wxString &colName, bool set=TRUE);
#if wxODBC_BACKWARD_COMPATABILITY
// The following member functions are deprecated. You should use the SetColNull()
- bool SetNull(int colNo, bool set=true) { return (SetNull(colNo,set)); }
- bool SetNull(const char *colName, bool set=true) { return (SetNull(colName,set)); }
+ bool SetNull(int colNo, bool set=TRUE) { return (SetNull(colNo,set)); }
+ bool SetNull(const char *colName, bool set=TRUE) { return (SetNull(colName,set)); }
#endif
#ifdef __WXDEBUG__
ULONG GetTableID() { return tableID; }
wxDbConnectInf::wxDbConnectInf()
{
Henv = 0;
- freeHenvOnDestroy = false;
+ freeHenvOnDestroy = FALSE;
Initialize();
} // Constructor
const wxString &fileType, const wxString &description)
{
Henv = 0;
- freeHenvOnDestroy = false;
+ freeHenvOnDestroy = FALSE;
Initialize();
/********** wxDbConnectInf::Initialize() **********/
bool wxDbConnectInf::Initialize()
{
- freeHenvOnDestroy = false;
+ freeHenvOnDestroy = FALSE;
if (freeHenvOnDestroy && Henv)
FreeHenv();
FileType.Empty();
DefaultDir.Empty();
- return true;
+ return TRUE;
} // wxDbConnectInf::Initialize()
if (SQLAllocEnv(&Henv) != SQL_SUCCESS)
{
wxLogDebug(wxT("A problem occured while trying to get a connection to the data source"));
- return false;
+ return FALSE;
}
- freeHenvOnDestroy = true;
+ freeHenvOnDestroy = TRUE;
- return true;
+ return TRUE;
} // wxDbConnectInf::AllocHenv()
SQLFreeEnv(Henv);
Henv = 0;
- freeHenvOnDestroy = false;
+ freeHenvOnDestroy = FALSE;
} // wxDbConnectInf::FreeHenv()
s_Field.Printf(wxT("Unknown Format(%d)-SQL(%d)"),dbDataType,sqlDataType); //
break;
};
- return true;
+ return TRUE;
} // wxDbColFor::Format()
FkTableName[0] = 0;
pColFor = NULL;
- return true;
+ return TRUE;
} // wxDbColInf::Initialize()
numCols = 0;
pColInf = NULL;
- return true;
+ return TRUE;
} // wxDbTableInf::Initialize()
numTables = 0;
pTableInf = NULL;
- return true;
+ return TRUE;
} // wxDbInf::Initialize()
typeInfBlob.MaximumScale = 0;
// Error reporting is turned OFF by default
- silent = true;
+ silent = TRUE;
// Allocate a data source connection handle
if (SQLAllocConnect(henv, &hdbc) != SQL_SUCCESS)
DB_STATUS = 0;
// Mark database as not open as of yet
- dbIsOpen = false;
- dbIsCached = false;
+ dbIsOpen = FALSE;
+ dbIsCached = FALSE;
} // wxDb::initialize()
*/
// Mark database as open
- dbIsOpen = true;
+ dbIsOpen = TRUE;
// Allocate a statement handle for the database connection
if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS)
// Set Connection Options
if (!setConnectionOptions())
- return(false);
+ return(FALSE);
// Query the data source for inf. about itself
if (!getDbInfo())
- return(false);
+ return(FALSE);
// Query the data source regarding data type information
// VARCHAR = Variable length character string
if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar))
- return(false);
+ return(FALSE);
else
typeInfVarchar.FsqlType = SQL_CHAR;
else
if (!getDataTypeInfo(SQL_FLOAT,typeInfFloat))
if (!getDataTypeInfo(SQL_DECIMAL,typeInfFloat))
if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat))
- return(false);
+ return(FALSE);
else
typeInfFloat.FsqlType = SQL_NUMERIC;
else
// If SQL_INTEGER is not supported, use the floating point
// data type to store integers as well as floats
if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
- return(false);
+ return(FALSE);
else
typeInfInteger.FsqlType = typeInfFloat.FsqlType;
}
if (Dbms() != dbmsDBASE)
{
if (!getDataTypeInfo(SQL_TIMESTAMP,typeInfDate))
- return(false);
+ return(FALSE);
else
typeInfDate.FsqlType = SQL_TIMESTAMP;
}
else
{
if (!getDataTypeInfo(SQL_DATE,typeInfDate))
- return(false);
+ return(FALSE);
else
typeInfDate.FsqlType = SQL_DATE;
}
if (!getDataTypeInfo(SQL_LONGVARBINARY, typeInfBlob))
{
if (!getDataTypeInfo(SQL_VARBINARY,typeInfBlob))
- return(false);
+ return(FALSE);
else
typeInfBlob.FsqlType = SQL_VARBINARY;
}
#endif
// Completed Successfully
- return(true);
+ return(TRUE);
} // wxDb::Open()
*/
// Mark database as open
- dbIsOpen = true;
+ dbIsOpen = TRUE;
// Allocate a statement handle for the database connection
if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS)
// Set Connection Options
if (!setConnectionOptions())
- return(false);
+ return(FALSE);
// Instead of Querying the data source for info about itself, it can just be copied
// from the wxDb instance that was passed in (copyDb).
#endif
// Completed Successfully
- return(true);
+ return(TRUE);
} // wxDb::Open() 2
#endif
// Completed Successfully
- return(true);
+ return(TRUE);
} // wxDb::setConnectionOptions()
#endif
// Completed Successfully
- return(true);
+ return(TRUE);
} // wxDb::getDbInfo()
#endif
DispAllErrors(henv, hdbc, hstmt);
SQLFreeStmt(hstmt, SQL_CLOSE);
- return(false);
+ return(FALSE);
}
wxChar typeName[DB_TYPE_NAME_LEN+1];
return(DispAllErrors(henv, hdbc, hstmt));
// Completed Successfully
- return(true);
+ return(TRUE);
} // wxDb::getDataTypeInfo()
wxStrcpy(DBerrorList[i], errorList[i]);
dbmsType = dbmsUNIDENTIFIED;
- dbIsOpen = false;
+ dbIsOpen = FALSE;
} // wxDb::Close()
}
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDb::CommitTrans()
return(DispAllErrors(henv, hdbc));
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDb::RollbackTrans()
* If in DBDEBUG_CONSOLE mode, the constructed string will be displayed in the console
* window and program execution will be paused until the user presses a key.
*
- * This function always returns a false, so that functions which call this function
+ * This function always returns a FALSE, so that functions which call this function
* can have a line like "return (DispAllErrors(henv, hdbc));" to indicate the failure
* of the users request, so that the calling code can then process the error msg log
*/
}
}
- return(false); // This function always returns false.
+ return(FALSE); // This function always returns FALSE.
} // wxDb::DispAllErrors()
bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
{
if (SQLError(aHenv, aHdbc, aHstmt, (UCHAR FAR *) sqlState, &nativeError, (UCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS)
- return(true);
+ return(TRUE);
else
- return(false);
+ return(FALSE);
} // wxDb::GetNextError()
// Drop the view first
if (attemptDrop && !DropView(viewName))
- return false;
+ return FALSE;
// Build the create view statement
sqlStmt = wxT("CREATE VIEW ");
bool wxDb::DropView(const wxString &viewName)
{
/*
- * NOTE: This function returns true if the View does not exist, but
+ * NOTE: This function returns TRUE if the View does not exist, but
* only for identified databases. Code will need to be added
* below for any other databases when those databases are defined
* to handle this situation consistently
DispNextError();
DispAllErrors(henv, hdbc, hstmt);
RollbackTrans();
- return(false);
+ return(FALSE);
}
}
}
// Commit the transaction
if (!CommitTrans())
- return(false);
+ return(FALSE);
- return true;
+ return TRUE;
} // wxDb::DropView()
if (retcode == SQL_SUCCESS ||
(Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND)))
{
- return(true);
+ return(TRUE);
}
else
{
DispAllErrors(henv, hdbc, hstmt);
- return(false);
+ return(FALSE);
}
} // wxDb::ExecSql()
bool wxDb::GetNext(void)
{
if (SQLFetch(hstmt) == SQL_SUCCESS)
- return(true);
+ return(TRUE);
else
{
DispAllErrors(henv, hdbc, hstmt);
- return(false);
+ return(FALSE);
}
} // wxDb::GetNext()
wxASSERT(cbReturned);
if (SQLGetData(hstmt, colNo, cType, pData, maxLen, cbReturned) == SQL_SUCCESS)
- return(true);
+ return(TRUE);
else
{
DispAllErrors(henv, hdbc, hstmt);
- return(false);
+ return(FALSE);
}
} // wxDb::GetData()
} // while
SQLFreeStmt(hstmt, SQL_CLOSE); /* Close the cursor (the hstmt is still allocated). */
- return true;
+ return TRUE;
} // wxDb::GetKeyFields()
FILE *fp = fopen(fileName.c_str(),wxT("wt"));
if (fp == NULL)
- return(false);
+ return(FALSE);
SQLFreeStmt(hstmt, SQL_CLOSE);
{
DispAllErrors(henv, hdbc, hstmt);
fclose(fp);
- return(false);
+ return(FALSE);
}
wxString outStr;
{
SQLFreeStmt(hstmt, SQL_CLOSE);
fclose(fp);
- return(false);
+ return(FALSE);
}
cnt++;
}
bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wxString &tablePath)
/*
- * Table name can refer to a table, view, alias or synonym. Returns true
+ * Table name can refer to a table, view, alias or synonym. Returns TRUE
* if the object exists in the database. This function does not indicate
* whether or not the user has privleges to query or perform other functions
* on the table.
SQLFreeStmt(hstmt, SQL_CLOSE);
- return(true);
+ return(TRUE);
} // wxDb::TableExists()
if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO))
return(DispAllErrors(henv, hdbc, hstmt));
- bool failed = false;
+ bool failed = FALSE;
retcode = SQLFetch(hstmt);
while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
{
if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (!failed && SQLGetData(hstmt, 2, SQL_C_CHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (!failed && SQLGetData(hstmt, 3, SQL_C_CHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (!failed && SQLGetData(hstmt, 4, SQL_C_CHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (!failed && SQLGetData(hstmt, 5, SQL_C_CHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (!failed && SQLGetData(hstmt, 6, SQL_C_CHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (!failed && SQLGetData(hstmt, 7, SQL_C_CHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS)
- failed = true;
+ failed = TRUE;
if (failed)
{
result.grantor, result.grantee);
#endif
- if (UserID.IsSameAs(result.tableOwner,false))
+ if (UserID.IsSameAs(result.tableOwner,FALSE))
{
SQLFreeStmt(hstmt, SQL_CLOSE);
- return true;
+ return TRUE;
}
- if (UserID.IsSameAs(result.grantee,false) &&
+ if (UserID.IsSameAs(result.grantee,FALSE) &&
!wxStrcmp(result.privilege,priv))
{
SQLFreeStmt(hstmt, SQL_CLOSE);
- return true;
+ return TRUE;
}
if (!wxStrcmp(result.grantee,curRole) &&
!wxStrcmp(result.privilege,priv))
{
SQLFreeStmt(hstmt, SQL_CLOSE);
- return true;
+ return TRUE;
}
retcode = SQLFetch(hstmt);
}
SQLFreeStmt(hstmt, SQL_CLOSE);
- return false;
+ return FALSE;
} // wxDb::TablePrivileges
{
fpSqlLog = fopen(filename, (append ? wxT("at") : wxT("wt")));
if (fpSqlLog == NULL)
- return(false);
+ return(FALSE);
}
}
else // sqlLogOFF
if (fpSqlLog)
{
if (fclose(fpSqlLog))
- return(false);
+ return(FALSE);
fpSqlLog = 0;
}
}
sqlLogState = state;
- return(true);
+ return(TRUE);
} // wxDb::SetSqlLogging()
wxASSERT(logMsg.Length());
if (fpSqlLog == 0 || sqlLogState == sqlLogOFF)
- return(false);
+ return(FALSE);
if (fputs(wxT("\n"), fpSqlLog) == EOF)
- return(false);
+ return(FALSE);
if (fputs(logMsg, fpSqlLog) == EOF)
- return(false);
+ return(FALSE);
if (fputs(wxT("\n"), fpSqlLog) == EOF)
- return(false);
+ return(FALSE);
- return(true);
+ return(TRUE);
} // wxDb::WriteSqlLog()
* - Does not support the SQL_TIMESTAMP structure
* - Supports only one cursor and one connect (apparently? with Microsoft driver only?)
* - Does not automatically create the primary index if the 'keyField' param of SetColDef
- * is true. The user must create ALL indexes from their program.
+ * is TRUE. The user must create ALL indexes from their program.
* - Table names can only be 8 characters long
* - Column names can only be 10 characters long
*
*
* MY_SQL
* - If a column is part of the Primary Key, the column cannot be NULL
- * - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns false
+ * - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns FALSE
* - Columns that are part of primary or secondary keys must be defined as being NOT NULL
* when they are created. Some code is added in ::CreateIndex to try to adjust the
* column definition if it is not defined correctly, but it is experimental
// Must specify a columnLength if modifying a VARCHAR type column
if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength)
- return false;
+ return FALSE;
wxString dataTypeName;
wxString sqlStmt;
dataTypeName = typeInfBlob.TypeName;
break;
default:
- return false;
+ return FALSE;
}
// Set the modify or alter syntax depending on the type of database connected to
alterSlashModify = "ALTER COLUMN";
break;
case dbmsUNIDENTIFIED :
- return false;
+ return FALSE;
case dbmsSYBASE_ASA :
case dbmsSYBASE_ASE :
case dbmsMY_SQL :
(pList->PtrDb->FwdOnlyCursors() == FwdOnlyCursors) &&
(!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn))) // Found a free connection
{
- pList->Free = false;
+ pList->Free = FALSE;
return(pList->PtrDb);
}
// Initialize new node in the linked list
pList->PtrNext = 0;
- pList->Free = false;
+ pList->Free = FALSE;
pList->Dsn = pDbConfig->GetDsn();
pList->Uid = pDbConfig->GetUserID();
pList->AuthStr = pDbConfig->GetPassword();
pList->PtrDb = new wxDb(pDbConfig->GetHenv(), FwdOnlyCursors);
- bool opened = false;
+ bool opened = FALSE;
if (!matchingDbConnection)
opened = pList->PtrDb->Open(pDbConfig->GetDsn(), pDbConfig->GetUserID(), pDbConfig->GetPassword());
// Connect to the datasource
if (opened)
{
- pList->PtrDb->setCached(true); // Prevent a user from deleting a cached connection
- pList->PtrDb->SetSqlLogging(SQLLOGstate,SQLLOGfn,true);
+ pList->PtrDb->setCached(TRUE); // Prevent a user from deleting a cached connection
+ pList->PtrDb->SetSqlLogging(SQLLOGstate,SQLLOGfn,TRUE);
return(pList->PtrDb);
}
else // Unable to connect, destroy list item
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
{
if (pList->PtrDb == pDb) // Found it, now free it!!!
- return (pList->Free = true);
+ return (pList->Free = TRUE);
}
// Never found the database object, return failure
- return(false);
+ return(FALSE);
} // wxDbFreeConnection()
pNext = pList->PtrNext; // Save the pointer to next
pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object
pList->PtrDb->Close(); // Close the wxDb object
- pList->PtrDb->setCached(false); // Allows deletion of the wxDb instance
+ pList->PtrDb->setCached(FALSE); // Allows deletion of the wxDb instance
delete pList->PtrDb; // Deletes the wxDb object
delete pList; // Deletes the linked list object
}
// Scan the linked list counting db connections that are currently in use
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
{
- if (pList->Free == false)
+ if (pList->Free == FALSE)
cnt++;
}
/********** wxDbSqlLog() **********/
bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename)
{
- bool append = false;
+ bool append = FALSE;
wxDbList *pList;
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
{
if (!pList->PtrDb->SetSqlLogging(state,filename,append))
- return(false);
- append = true;
+ return(FALSE);
+ append = TRUE;
}
SQLLOGstate = state;
SQLLOGfn = filename;
- return(true);
+ return(TRUE);
} // wxDbSqlLog()
* ODBC driver must be ODBC 3.0 compliant to use this function
*/
{
- int result = false;
+ int result = FALSE;
//!!!! ONLY FUNCTIONAL UNDER MSW with VC6 !!!!
#ifdef __VISUALC__
int k;
do
{
- k = setupStr.Find((wxChar)2,true);
+ k = setupStr.Find((wxChar)2,TRUE);
if (k != wxNOT_FOUND)
setupStr[(UINT)k] = wxT('\0');
}
}
}
else
- result = true;
+ result = TRUE;
#else
// Using iODBC/unixODBC or some other compiler which does not support the APIs
// necessary to use this function, so this function is not supported
#ifdef __WXDEBUG__
wxLogDebug(wxT("wxDbCreateDataSource() not available except under VC++/MSW"),wxT("ODBC DEBUG MESSAGE"));
#endif
- result = false;
+ result = FALSE;
#endif // __VISUALC__
return result;
if (SQLDataSources(henv, direction, (UCHAR FAR *) Dsn, DsnMax, &cb1,
(UCHAR FAR *) DsDesc, DsDescMax, &cb2) == SQL_SUCCESS)
- return(true);
+ return(TRUE);
else
- return(false);
+ return(FALSE);
} // wxDbGetDataSource()
m_keys(),
m_data(tab),
m_dbowner(takeOwnership),
- m_rowmodified(false)
+ m_rowmodified(FALSE)
{
if (count == wxUSE_QUERY)
// use the default attr provider by default
SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo));
}
- return true;
+ return TRUE;
}
grid->EndBatch();
}
m_dbowner = takeOwnership;
- m_rowmodified = false;
- return true;
+ m_rowmodified = FALSE;
+ return TRUE;
}
wxString wxDbGridTableBase::GetTypeName(int row, int col)
if (typeName == wxGRID_VALUE_STRING)
{
//FIXME ummm What about blob field etc.
- return true;
+ return TRUE;
}
if (m_data->IsColNull(m_ColInfo[col].DbCol))
{
- return false;
+ return FALSE;
}
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
{
//If a virtual column then we can't find it's type. we have to
- // return false to get using wxVariant.
- return false;
+ // return FALSE to get using wxVariant.
+ return FALSE;
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
(sqltype == SQL_C_TIME) ||
(sqltype == SQL_C_TIMESTAMP))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (typeName == wxGRID_VALUE_NUMBER)
{
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (typeName == wxGRID_VALUE_FLOAT)
{
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_DOUBLE))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
bool wxDbGridTableBase::CanSetValueAs(int row, int col, const wxString& typeName)
if (m_data->IsColNull(m_ColInfo[col].DbCol))
{
- return false;
+ return FALSE;
}
if (typeName == wxGRID_VALUE_STRING)
{
//FIXME ummm What about blob field etc.
- return true;
+ return TRUE;
}
if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable))
{
- return false;
+ return FALSE;
}
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
{
//If a virtual column then we can't find it's type. we have to faulse to
//get using wxVairent.
- return false;
+ return FALSE;
}
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
(sqltype == SQL_C_TIME) ||
(sqltype == SQL_C_TIMESTAMP))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (typeName == wxGRID_VALUE_NUMBER)
{
(sqltype == SQL_C_SLONG) ||
(sqltype == SQL_C_ULONG))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (typeName == wxGRID_VALUE_FLOAT)
{
(sqltype == SQL_C_FLOAT) ||
(sqltype == SQL_C_DOUBLE))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
long wxDbGridTableBase::GetValueAsLong(int row, int col)
return;
}
wxVariant val(date);
- m_rowmodified = true;
+ m_rowmodified = TRUE;
m_data->SetCol(m_ColInfo[col].DbCol,val);
}
}
ValidateRow(row);
wxVariant val(value);
- m_rowmodified = true;
+ m_rowmodified = TRUE;
m_data->SetCol(m_ColInfo[col].DbCol,val);
}
ValidateRow(row);
wxVariant val(value);
- m_rowmodified = true;
+ m_rowmodified = TRUE;
m_data->SetCol(m_ColInfo[col].DbCol,val);
}
ValidateRow(row);
wxVariant val(value);
- m_rowmodified = true;
+ m_rowmodified = TRUE;
m_data->SetCol(m_ColInfo[col].DbCol,val);
}
ValidateRow(row);
wxVariant val(value);
- m_rowmodified = true;
+ m_rowmodified = TRUE;
m_data->SetCol(m_ColInfo[col].DbCol,val);
}
m_row = row;
}
- m_rowmodified = false;
+ m_rowmodified = FALSE;
}
bool wxDbGridTableBase::Writeback() const
{
if (!m_rowmodified)
{
- return true;
+ return TRUE;
}
- bool result=true;
+ bool result=TRUE;
wxLogDebug(wxT("\trow key unknown"));
// FIXME: this code requires dbtable support for record status
SqlCtype = SQL_C_LONG;
PtrDataObj = NULL;
SzDataObj = 0;
- KeyField = false;
- Updateable = false;
- InsertAllowed = false;
- DerivedCol = false;
+ KeyField = FALSE;
+ Updateable = FALSE;
+ InsertAllowed = FALSE;
+ DerivedCol = FALSE;
CbValue = 0;
- Null = false;
+ Null = FALSE;
- return true;
+ return TRUE;
} // wxDbColDef::Initialize()
where.Empty(); // Where clause
orderBy.Empty(); // Order By clause
from.Empty(); // From clause
- selectForUpdate = false; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase
+ selectForUpdate = FALSE; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase
queryOnly = qryOnly;
- insertable = true;
+ insertable = TRUE;
tablePath.Empty();
tableName.Empty();
queryTableName.Empty();
wxASSERT(pDb);
if (!pDb)
- return false;
+ return FALSE;
tableName = tblName; // Table Name
if (tblPath.Length())
{
// Should never happen
pDb->GetNextError(henv, hdbc, hstmtInternal);
- return false;
+ return FALSE;
}
}
}
}
// Make the default cursor the active cursor
- hstmtDefault = GetNewCursor(false,false);
+ hstmtDefault = GetNewCursor(FALSE,FALSE);
wxASSERT(hstmtDefault);
hstmt = *hstmtDefault;
- return true;
+ return TRUE;
} // wxDbTable::initialize()
#ifdef __WXDEBUG__
if (tableID)
{
- TablesInUse.DeleteContents(true);
- bool found = false;
+ TablesInUse.DeleteContents(TRUE);
+ bool found = FALSE;
wxNode *pNode;
pNode = TablesInUse.First();
{
if (((wxTablesInUse *)pNode->Data())->tableID == tableID)
{
- found = true;
+ found = TRUE;
if (!TablesInUse.DeleteNode(pNode))
wxLogDebug (s,wxT("Unable to delete node!"));
}
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
SWORD fSqlType = 0;
UDWORD precision = 0;
}
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDbTable::bindParams()
/********** wxDbTable::bindInsertParams() **********/
bool wxDbTable::bindInsertParams(void)
{
- return bindParams(false);
+ return bindParams(FALSE);
} // wxDbTable::bindInsertParams()
/********** wxDbTable::bindUpdateParams() **********/
bool wxDbTable::bindUpdateParams(void)
{
- return bindParams(true);
+ return bindParams(TRUE);
} // wxDbTable::bindUpdateParams()
}
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDbTable::bindCols()
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
{
if (retcode == SQL_NO_DATA_FOUND)
- return(false);
+ return(FALSE);
else
return(pDb->DispAllErrors(henv, hdbc, hstmt));
}
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
{
if (retcode == SQL_NO_DATA_FOUND)
- return(false);
+ return(FALSE);
else
return(pDb->DispAllErrors(henv, hdbc, hstmt));
}
}
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDbTable::getRec()
retcode == SQL_SUCCESS_WITH_INFO)
{
// Record deleted successfully
- return(true);
+ return(TRUE);
}
// Problem deleting record
retcode == SQL_SUCCESS_WITH_INFO)
{
// Record updated successfully
- return(true);
+ return(TRUE);
}
// Problem updating record
// The user may wish to select for update, but the DBMS may not be capable
selectForUpdate = CanSelectForUpdate();
else
- selectForUpdate = false;
+ selectForUpdate = FALSE;
// Set the SQL SELECT string
if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in,
// Make sure the cursor is closed first
if (!CloseCursor(hstmt))
- return(false);
+ return(FALSE);
// Execute the SQL SELECT statement
int retcode;
return(pDb->DispAllErrors(henv, hdbc, hstmt));
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDbTable::query()
bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
{
if (!pDb)
- return false;
+ return FALSE;
int i;
wxString sqlStmt;
p += s;
pDb->LogError(p.GetData());
- return(false);
+ return(FALSE);
}
// Bind the member variables for field exchange between
if (!queryOnly)
{
if (!bindInsertParams()) // Inserts
- return(false);
+ return(FALSE);
if (!bindUpdateParams()) // Updates
- return(false);
+ return(FALSE);
}
if (!bindCols(*hstmtDefault)) // Selects
- return(false);
+ return(FALSE);
if (!bindCols(hstmtInternal)) // Internal use only
- return(false);
+ return(FALSE);
/*
* Do NOT bind the hstmtCount cursor!!!
// Build an insert statement using parameter markers
if (!queryOnly && noCols > 0)
{
- bool needComma = false;
+ bool needComma = FALSE;
sqlStmt.Printf(wxT("INSERT INTO %s ("), tableName.c_str());
for (i = 0; i < noCols; i++)
{
if (needComma)
sqlStmt += wxT(",");
sqlStmt += colDefs[i].ColName;
- needComma = true;
+ needComma = TRUE;
}
- needComma = false;
+ needComma = FALSE;
sqlStmt += wxT(") VALUES (");
int insertableCount = 0;
if (needComma)
sqlStmt += wxT(",");
sqlStmt += wxT("?");
- needComma = true;
+ needComma = TRUE;
insertableCount++;
}
sqlStmt += wxT(")");
return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
}
else
- insertable= false;
+ insertable= FALSE;
}
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDbTable::Open()
{
pDb->WriteSqlLog(pSqlStmt);
- return(query(DB_SELECT_STATEMENT, false, false, pSqlStmt));
+ return(query(DB_SELECT_STATEMENT, FALSE, FALSE, pSqlStmt));
} // wxDbTable::QueryBySqlStmt()
if (pDb->FwdOnlyCursors())
{
wxFAIL_MSG(wxT("GetPrev()::Backward scrolling cursors are not enabled for this instance of wxDbTable"));
- return false;
+ return FALSE;
}
else
return(getRec(SQL_FETCH_PRIOR));
if (pDb->FwdOnlyCursors())
{
wxFAIL_MSG(wxT("operator--:Backward scrolling cursors are not enabled for this instance of wxDbTable"));
- return false;
+ return FALSE;
}
else
return(getRec(SQL_FETCH_PRIOR));
if (pDb->FwdOnlyCursors())
{
wxFAIL_MSG(wxT("GetFirst():Backward scrolling cursors are not enabled for this instance of wxDbTable"));
- return false;
+ return FALSE;
}
else
return(getRec(SQL_FETCH_FIRST));
if (pDb->FwdOnlyCursors())
{
wxFAIL_MSG(wxT("GetLast()::Backward scrolling cursors are not enabled for this instance of wxDbTable"));
- return false;
+ return FALSE;
}
else
return(getRec(SQL_FETCH_LAST));
// Was a FROM clause specified to join tables to the base table?
// Available for ::Query() only!!!
- bool appendFromClause = false;
+ bool appendFromClause = FALSE;
#if wxODBC_BACKWARD_COMPATABILITY
if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from))
- appendFromClause = true;
+ appendFromClause = TRUE;
#else
if (typeOfSelect == DB_SELECT_WHERE && from.Length())
- appendFromClause = true;
+ appendFromClause = TRUE;
#endif
// Add the column list
wxString whereClause;
whereClause.Empty();
- bool firstColumn = true;
+ bool firstColumn = TRUE;
pSqlStmt.Printf(wxT("UPDATE %s SET "), tableName.Upper().c_str());
if (!firstColumn)
pSqlStmt += wxT(",");
else
- firstColumn = false;
+ firstColumn = FALSE;
pSqlStmt += colDefs[i].ColName;
pSqlStmt += wxT(" = ?");
}
* They are not included as part of the where clause.
*/
{
- bool moreThanOneColumn = false;
+ bool moreThanOneColumn = FALSE;
wxString colValue;
// Loop through the columns building a where clause as you go
if (moreThanOneColumn)
pWhereClause += wxT(" AND ");
else
- moreThanOneColumn = true;
+ moreThanOneColumn = TRUE;
// Concatenate where phrase for the column
if (qualTableName.Length())
{
return(pDb->DispAllErrors(henv, hdbc, cursor));
// Completed successfully
- return(true);
+ return(TRUE);
} // wxDbTable::CloseCursor()
bool wxDbTable::CreateTable(bool attemptDrop)
{
if (!pDb)
- return false;
+ return FALSE;
int i, j;
wxString sqlStmt;
// Drop table first
if (attemptDrop && !DropTable())
- return false;
+ return FALSE;
// Create the table
#ifdef DBDEBUG_CONSOLE
#endif
// Build a CREATE TABLE string from the colDefs structure.
- bool needComma = false;
+ bool needComma = FALSE;
sqlStmt.Printf(wxT("CREATE TABLE %s ("), tableName.c_str());
for (i = 0; i < noCols; i++)
}
}
- needComma = true;
+ needComma = TRUE;
}
// If there is a primary key defined, include it in the create statement
for (i = j = 0; i < noCols; i++)
pDb->DispAllErrors(henv, hdbc, hstmt);
pDb->RollbackTrans();
CloseCursor(hstmt);
- return(false);
+ return(FALSE);
}
// Commit the transaction and close the cursor
if (!pDb->CommitTrans())
- return(false);
+ return(FALSE);
if (!CloseCursor(hstmt))
- return(false);
+ return(FALSE);
// Database table created successfully
- return(true);
+ return(TRUE);
} // wxDbTable::CreateTable()
/********** wxDbTable::DropTable() **********/
bool wxDbTable::DropTable()
{
- // NOTE: This function returns true if the Table does not exist, but
+ // NOTE: This function returns TRUE if the Table does not exist, but
// only for identified databases. Code will need to be added
// below for any other databases when those databases are defined
// to handle this situation consistently
pDb->DispAllErrors(henv, hdbc, hstmt);
pDb->RollbackTrans();
// CloseCursor(hstmt);
- return(false);
+ return(FALSE);
}
}
}
// Commit the transaction and close the cursor
if (! pDb->CommitTrans())
- return(false);
+ return(FALSE);
if (! CloseCursor(hstmt))
- return(false);
+ return(FALSE);
- return(true);
+ return(TRUE);
} // wxDbTable::DropTable()
// Drop the index first
if (attemptDrop && !DropIndex(idxName))
- return (false);
+ return (FALSE);
// MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions
// of an index have the columns defined as "NOT NULL". During initial table creation though,
{
wxString sqlStmt;
int i;
- bool ok = true;
+ bool ok = TRUE;
for (i = 0; i < noIdxCols && ok; i++)
{
int j = 0;
- bool found = false;
+ bool found = FALSE;
// Find the column definition that has the ColName that matches the
// index column name. We need to do this to get the DB_DATA_TYPE of
// the index column, as MySQL's syntax for the ALTER column requires
while (!found && (j < this->noCols))
{
if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0)
- found = true;
+ found = TRUE;
if (!found)
j++;
}
}
}
else
- ok = false;
+ ok = FALSE;
}
if (ok)
pDb->CommitTrans();
else
{
pDb->RollbackTrans();
- return(false);
+ return(FALSE);
}
}
pDb->DispAllErrors(henv, hdbc, hstmt);
pDb->RollbackTrans();
CloseCursor(hstmt);
- return(false);
+ return(FALSE);
}
// Commit the transaction and close the cursor
if (! pDb->CommitTrans())
- return(false);
+ return(FALSE);
if (! CloseCursor(hstmt))
- return(false);
+ return(FALSE);
// Index Created Successfully
- return(true);
+ return(TRUE);
} // wxDbTable::CreateIndex()
/********** wxDbTable::DropIndex() **********/
bool wxDbTable::DropIndex(const wxString &idxName)
{
- // NOTE: This function returns true if the Index does not exist, but
+ // NOTE: This function returns TRUE if the Index does not exist, but
// only for identified databases. Code will need to be added
// below for any other databases when those databases are defined
// to handle this situation consistently
pDb->DispAllErrors(henv, hdbc, hstmt);
pDb->RollbackTrans();
CloseCursor(hstmt);
- return(false);
+ return(FALSE);
}
}
}
// Commit the transaction and close the cursor
if (! pDb->CommitTrans())
- return(false);
+ return(FALSE);
if (! CloseCursor(hstmt))
- return(false);
+ return(FALSE);
- return(true);
+ return(TRUE);
} // wxDbTable::DropIndex()
int colNo = first; // using 'int' to be able to look for wxDB_NO_MORE_COLUN_NUMBERS
va_list argptr;
- bool abort = false;
+ bool abort = FALSE;
wxString tempStr;
va_start(argptr, first); /* Initialize variable arguments. */
// Valid columns are 0 thru noCols-1
if (colNo >= noCols || colNo < 0)
{
- abort = true;
+ abort = TRUE;
continue;
}
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
wxString sqlStmt;
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
pDb->WriteSqlLog(pSqlStmt);
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
wxString sqlStmt;
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
wxString sqlStmt;
sqlStmt.Empty();
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
wxString sqlStmt;
sqlStmt.Empty();
{
wxASSERT(!queryOnly);
if (queryOnly)
- return(false);
+ return(FALSE);
wxString sqlStmt;
sqlStmt.Empty();
bool wxDbTable::IsColNull(UWORD colNo) const
{
/*
- This logic is just not right. It would indicate true
+ This logic is just not right. It would indicate TRUE
if a numeric field were set to a value of 0.
switch(colDefs[colNo].SqlCtype)
TIMESTAMP_STRUCT *pDt;
pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
- return(true);
+ return(TRUE);
else
- return(false);
+ return(FALSE);
default:
- return(true);
+ return(TRUE);
}
*/
return (colDefs[colNo].Null);
bool wxDbTable::CanSelectForUpdate(void)
{
if (queryOnly)
- return false;
+ return FALSE;
if (pDb->Dbms() == dbmsMY_SQL)
- return false;
+ return FALSE;
if ((pDb->Dbms() == dbmsORACLE) ||
(pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE))
- return(true);
+ return(TRUE);
else
- return(false);
+ return(FALSE);
} // wxDbTable::CanSelectForUpdate()
bool wxDbTable::CanUpdByROWID(void)
{
/*
- * NOTE: Returning false for now until this can be debugged,
+ * NOTE: Returning FALSE for now until this can be debugged,
* as the ROWID is not getting updated correctly
*/
- return false;
+ return FALSE;
/*
if (pDb->Dbms() == dbmsORACLE)
- return(true);
+ return(TRUE);
else
- return(false);
+ return(FALSE);
*/
} // wxDbTable::CanUpdByROWID()
bool wxDbTable::IsCursorClosedOnCommit(void)
{
if (pDb->dbInf.cursorCommitBehavior == SQL_CB_PRESERVE)
- return(false);
+ return(FALSE);
else
- return(true);
+ return(TRUE);
} // wxDbTable::IsCursorClosedOnCommit()
return(pDb->DispAllErrors(henv, hdbc, hstmtInternal));
// Completed Successfully
- return(true);
+ return(TRUE);
} // wxDbTable::SetQueryTimeout()
// Derived columns by definition would NOT be "Insertable" or "Updateable"
if (derivedCol)
{
- colDefs[index].Updateable = false;
- colDefs[index].InsertAllowed = false;
+ colDefs[index].Updateable = FALSE;
+ colDefs[index].InsertAllowed = FALSE;
}
else
{
colDefs[index].InsertAllowed = insAllow;
}
- colDefs[index].Null = false;
+ colDefs[index].Null = FALSE;
} // wxDbTable::SetColDefs()
// Initialize the Count cursor if it's not already initialized
if (!hstmtCount)
{
- hstmtCount = GetNewCursor(false,false);
+ hstmtCount = GetNewCursor(FALSE,FALSE);
wxASSERT(hstmtCount);
if (!hstmtCount)
return(0);
/********** wxDbTable::Refresh() **********/
bool wxDbTable::Refresh(void)
{
- bool result = true;
+ bool result = TRUE;
// Switch to the internal cursor so any active cursors are not corrupted
HSTMT currCursor = GetCursor();
where = whereClause;
orderBy.Empty();
if (!Query())
- result = false;
+ result = FALSE;
if (result && !GetNext())
- result = false;
+ result = FALSE;
// Switch back to original cursor
SetCursor(&currCursor);
{
colDefs[colNo].Null = set;
if (set) // Blank out the values in the member variable
- ClearMemberVar(colNo,false); // Must call with false, or infinite recursion will happen
- return(true);
+ ClearMemberVar(colNo,FALSE); // Must call with FALSE, or infinite recursion will happen
+ return(TRUE);
}
else
- return(false);
+ return(FALSE);
} // wxDbTable::SetColNull()
{
colDefs[i].Null = set;
if (set) // Blank out the values in the member variable
- ClearMemberVar(i,false); // Must call with false, or infinite recursion will happen
- return(true);
+ ClearMemberVar(i,FALSE); // Must call with FALSE, or infinite recursion will happen
+ return(TRUE);
}
else
- return(false);
+ return(FALSE);
} // wxDbTable::SetColNull()
/********** wxDbTable::DeleteCursor() **********/
bool wxDbTable::DeleteCursor(HSTMT *hstmtDel)
{
- bool result = true;
+ bool result = TRUE;
if (!hstmtDel) // Cursor already deleted
return(result);
if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
{
pDb->DispAllErrors(henv, hdbc);
- result = false;
+ result = FALSE;
}
delete hstmtDel;
{
if (!m_hstmtGridQuery)
{
- m_hstmtGridQuery = GetNewCursor(false,false);
+ m_hstmtGridQuery = GetNewCursor(FALSE,FALSE);
if (!bindCols(*m_hstmtGridQuery))
return;
}
{
//Returns null if invalid!
if (!dateval.ParseDate(val.GetString()))
- SetColNull(col,true);
+ SetColNull(col,TRUE);
}
switch (colDefs[col].SqlCtype)
{
if (colDefs[i].KeyField)
{
- SetColNull(i, false);
+ SetColNull(i, FALSE);
memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj);
blkptr += colDefs[i].SzDataObj;
}