]> git.saurik.com Git - wxWidgets.git/commitdiff
Added a param to ::Open() to allow the programmer to specify whether opening the...
authorGeorge Tasker <gtasker@allenbrook.com>
Tue, 10 Apr 2001 10:43:51 +0000 (10:43 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Tue, 10 Apr 2001 10:43:51 +0000 (10:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/db.tex
include/wx/dbtable.h
src/common/dbtable.cpp

index a798d8213c4297adf91dd7fdda9ceca5ff31933d..12149a8936cb4227ef071bf51f9d5cdd507f4b0a 100644 (file)
@@ -3110,7 +3110,7 @@ wxDbTable instance that would modify (insert/delete/update) the table's data.
 
 \membersection{wxDbTable::Open}\label{wxdbtableopen}
 
 
 \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 
 
 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 
@@ -3124,6 +3124,9 @@ row in the datasource.
 whether the current connected user has at least SELECT privileges to access the 
 table to which they are trying to open.  Default is FALSE.}
 
 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 
 \wxheading{Remarks}
 
 If the function returns a FALSE value due to the table not existing, a log 
index 2e98f16b35ab7c3a646243db9c25dac31e9d34f3..f402ea53689bd7f40349d3c8b223b95f150e9dbf 100644 (file)
@@ -205,7 +205,7 @@ public:
 
     virtual ~wxDbTable();
 
 
     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, 
     bool            CreateTable(bool attemptDrop=TRUE);
     bool            DropTable(void);
     bool            CreateIndex(const wxString &idxName, bool unique, int noIdxCols, 
@@ -215,7 +215,7 @@ public:
     // Accessors
 
     // The member variables returned by these accessors are all
     // 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 createand cannot be 
     // changed, hence there is no corresponding SetXxxx function
     wxDb           *GetDb()              { return pDb; }
     const wxString &GetTableName()       { return tableName; }
     // changed, hence there is no corresponding SetXxxx function
     wxDb           *GetDb()              { return pDb; }
     const wxString &GetTableName()       { return tableName; }
@@ -223,7 +223,6 @@ public:
     const wxString &GetTablePath()       { return tablePath; }
 
     int             GetNumberOfColumns() { return noCols; }  // number of "defined" columns for this wxDbTable instance
     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; }
 
     const wxString &GetFromClause()      { return from; }
     const wxString &GetOrderByClause()   { return orderBy; }
index a1f0a15eaf1aab2604e347ab68e5f6900bb332c0..107779f0b91aa9c6c7a22b5666d0b41c81b4c1a2 100644 (file)
@@ -694,7 +694,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri
 
 
 /********** wxDbTable::Open() **********/
 
 
 /********** wxDbTable::Open() **********/
-bool wxDbTable::Open(bool checkPrivileges)
+bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
 {
     if (!pDb)
         return FALSE;   
 {
     if (!pDb)
         return FALSE;   
@@ -705,7 +705,7 @@ bool wxDbTable::Open(bool checkPrivileges)
 
     s.Empty();
     // Verify that the table exists in the database
 
     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'))
     {
         s = wxT("Table/view does not exist in the database");
         if ( *(pDb->dbInf.accessibleTables) == wxT('Y'))