+ /***** These four functions only work with wxDb instances that are defined *****
+ ***** as not being FwdOnlyCursors *****/
+ bool GetPrev(void);
+ bool operator--(int);
+ bool GetFirst(void);
+ bool GetLast(void);
+
+ bool IsCursorClosedOnCommit(void);
+ UWORD GetRowNum(void);
+
+ void BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool distinct);
+ void BuildSelectStmt(wxChar *pSqlStmt, int typeOfSelect, bool distinct);
+
+ void BuildDeleteStmt(wxString &pSqlStmt, int typeOfDel, const wxString &pWhereClause=wxEmptyString);
+ void BuildDeleteStmt(wxChar *pSqlStmt, int typeOfDel, const wxString &pWhereClause=wxEmptyString);
+
+ void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpdate, const wxString &pWhereClause=wxEmptyString);
+ void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpdate, const wxString &pWhereClause=wxEmptyString);
+
+ void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false);
+ void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false);
+
+#if wxODBC_BACKWARD_COMPATABILITY
+// The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above)
+ void GetSelectStmt(char *pSqlStmt, int typeOfSelect, bool distinct)
+ { BuildSelectStmt(pSqlStmt,typeOfSelect,distinct); }
+ void GetDeleteStmt(char *pSqlStmt, int typeOfDel, const char *pWhereClause = NULL)
+ { BuildDeleteStmt(pSqlStmt,typeOfDel,pWhereClause); }
+ void GetUpdateStmt(char *pSqlStmt, int typeOfUpdate, const char *pWhereClause = NULL)
+ { BuildUpdateStmt(pSqlStmt,typeOfUpdate,pWhereClause); }
+ void GetWhereClause(char *pWhereClause, int typeOfWhere,
+ const char *qualTableName = NULL, bool useLikeComparison=false)
+ { BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); }
+#endif
+ bool CanSelectForUpdate(void);
+#if wxODBC_BACKWARD_COMPATABILITY
+ bool CanUpdByROWID(void) { return CanUpdateByRowID(); };
+#endif
+ bool CanUpdateByROWID(void);
+ void ClearMemberVar(UWORD colNumber, bool setToNull=false);
+ void ClearMemberVars(bool setToNull=false);
+ bool SetQueryTimeout(UDWORD nSeconds);
+
+ wxDbColDef *GetColDefs() { return colDefs; }
+ bool SetColDefs(UWORD index, const wxString &fieldName, int dataType,
+ void *pData, SWORD cType,
+ int size, bool keyField = false, bool updateable = true,
+ bool insertAllowed = true, bool derivedColumn = 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);
+#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); }
+#endif
+
+ ULONG Count(const wxString &args=_T("*"));
+ int DB_STATUS(void) { return(pDb->DB_STATUS); }
+
+ bool IsColNull(UWORD colNumber) const;
+ bool SetColNull(UWORD colNumber, 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 colNumber, bool set=true) { return (SetNull(colNumber,set)); }
+ bool SetNull(const char *colName, bool set=true) { return (SetNull(colName,set)); }
+#endif
+#ifdef __WXDEBUG__
+ ULONG GetTableID() { return tableID; }
+#endif
+
+//TODO: Need to Document
+ typedef enum { WX_ROW_MODE_QUERY , WX_ROW_MODE_INDIVIDUAL } rowmode_t;
+ virtual void SetRowMode(const rowmode_t rowmode);
+#if wxODBC_BACKWARD_COMPATABILITY
+ virtual wxVariant GetCol(const int colNumber) const { return GetColumn(colNumber); };
+ virtual void SetCol(const int colNumber, const wxVariant value) { return SetColumn(colNumber, value); };
+#endif
+ virtual wxVariant GetColumn(const int colNumber) const ;
+ virtual void SetColumn(const int colNumber, const wxVariant value);
+ virtual GenericKey GetKey(void);
+ virtual void SetKey(const GenericKey &key);
+
+ private:
+ HSTMT *m_hstmtGridQuery;
+ rowmode_t m_rowmode;
+ size_t m_keysize;
+
+// typedef enum {unmodified=0, UpdatePending, InsertPending } recStatus;
+
+// recStatus get_ModifiedStatus() { return m_recstatus; }
+
+// void modify() {
+// if (m_recstatus==unmodified)
+// m_recstatus=UpdatePending;
+// }
+// protected:
+// void insertify() {m_recstatus=InsertPending; }
+// void unmodify() {m_recstatus=unmodified; }
+// recStatus m_recstatus;
+//TODO: Need to Document
+}; // wxDbTable
+
+
+// Change this to 0 to remove use of all deprecated functions
+#if wxODBC_BACKWARD_COMPATABILITY
+//#################################################################################
+//############### DEPRECATED functions for backward compatibility #################
+//#################################################################################
+
+// Backward compability. These will eventually go away
+typedef wxDbTable wxTable;
+typedef wxDbIdxDef wxIdxDef;
+typedef wxDbIdxDef CidxDef;
+typedef wxDbColDef wxColDef;
+typedef wxDbColDef CcolDef;
+typedef wxDbColDataPtr wxColDataPtr;
+typedef wxDbColDataPtr CcolDataPtr;
+
+const int ROWID = wxDB_ROWID_LEN;
+const int DEFAULT_CURSOR = wxDB_DEFAULT_CURSOR;
+const bool QUERY_ONLY = wxDB_QUERY_ONLY;
+const bool DISABLE_VIEW = wxDB_DISABLE_VIEW;
+#endif
+
+#endif