\membersection{wxDbTable::Open}\label{wxdbtableopen}
-\func{bool }{Open}{\param{bool }{checkPrivileges=FALSE}}
+\func{bool }{Open}{\param{bool }{checkPrivileges=FALSE}, \param{bool }{checkTableExists=TRUE}}
Every wxDbTable instance must be opened before it can be used. This function
checks for the existence of the requested table, binds columns, creates required
whether the current connected user has at least SELECT privileges to access the
table to which they are trying to open. Default is FALSE.}
+\docparam{checkTableExists}{Indicates whether the Open() function should check
+whether the table exists in the database or not before opening it. Default is TRUE.}
+
\wxheading{Remarks}
If the function returns a FALSE value due to the table not existing, a log
virtual ~wxDbTable();
- bool Open(bool checkPrivileges=FALSE);
+ bool Open(bool checkPrivileges=FALSE, bool checkTableExists=TRUE);
bool CreateTable(bool attemptDrop=TRUE);
bool DropTable(void);
bool CreateIndex(const wxString &idxName, bool unique, int noIdxCols,
// Accessors
// The member variables returned by these accessors are all
- // set when the wxDbTable instance is createand cannot be
+ // set when the wxDbTable instance is created and cannot be
// changed, hence there is no corresponding SetXxxx function
wxDb *GetDb() { return pDb; }
const wxString &GetTableName() { return tableName; }
const wxString &GetTablePath() { return tablePath; }
int GetNumberOfColumns() { return noCols; } // number of "defined" columns for this wxDbTable instance
-
const wxString &GetFromClause() { return from; }
const wxString &GetOrderByClause() { return orderBy; }
/********** wxDbTable::Open() **********/
-bool wxDbTable::Open(bool checkPrivileges)
+bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
{
if (!pDb)
return FALSE;
s.Empty();
// Verify that the table exists in the database
- if (!pDb->TableExists(tableName,/*pDb->GetUsername()*/NULL,tablePath))
+ if (checkTableExists && !pDb->TableExists(tableName,/*pDb->GetUsername()*/NULL,tablePath))
{
s = wxT("Table/view does not exist in the database");
if ( *(pDb->dbInf.accessibleTables) == wxT('Y'))