git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9301
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
available and recommended for use in place of the wxDatabase class.
See details of these classes in:
available and recommended for use in place of the wxDatabase class.
See details of these classes in:
-\helpref{wxDB}{wxdb}, wxTable
+\helpref{wxDb}{wxdb}, \helpref{wxDbTable}{wxdbtable}
\latexignore{\rtfignore{\wxheading{Members}}}
\latexignore{\rtfignore{\wxheading{Members}}}
network traffic, database load, and connection creation time.
When the program is done using a connection created through a call to
network traffic, database load, and connection creation time.
When the program is done using a connection created through a call to
-wxDbGetConnection(), the program shoudl call wxDbFreeConnection() to release
+wxDbGetConnection(), the program should call wxDbFreeConnection() to release
the wxDb instance back to the cache. DO NOT DELETE THE wxDb INSTANCE!
Deleting the wxDb instance returned can cause a crash/memory corruption
later in the program when the cache is cleaned up.
the wxDb instance back to the cache. DO NOT DELETE THE wxDb INSTANCE!
Deleting the wxDb instance returned can cause a crash/memory corruption
later in the program when the cache is cleaned up.
// Close the wxDb connection when finished with it
sampleDB.Close();
// Close the wxDb connection when finished with it
sampleDB.Close();
-
- // Free Environment Handle that ODBC uses
- //
- // Be certain that no wxDb instances still exist
- // that were created using this handle! If you
- // use wxDbGetConnection() to get all the wxDb
- // instances, you can use wxDbConnectionsInUse()
- // to find out if any connections have not been
- // closed before calling this
- if (SQLFreeEnv(Db.Henv) != SQL_SUCCESS)
- {
- // Error freeing environment handle
- }
Calling this member function commits ALL open transactions on this ODBC
connection. For example, if three different wxDbTable instances used the
Calling this member function commits ALL open transactions on this ODBC
connection. For example, if three different wxDbTable instances used the
-same connection to the datasource, commiting changes made on one of those
+same connection to the datasource, committing changes made on one of those
wxDbTable instances commits any pending transactions on all three wxDbTable
instances.
wxDbTable instances commits any pending transactions on all three wxDbTable
instances.
\membersection{wxDb::ExecSql}\label{wxdbexecsql}
\membersection{wxDb::ExecSql}\label{wxdbexecsql}
\func{bool}{ExecSql}{\param{const wxString &}{pSqlStmt}}
Allows a native SQL command to be executed directly against the datasource. In addition to being able to run any standard SQL command, use of this function allows a user to (potentially) utilize features specific to the datasource they are connected to that may not be available through ODBC. The ODBC driver will pass the specified command directly to the datasource.
\func{bool}{ExecSql}{\param{const wxString &}{pSqlStmt}}
Allows a native SQL command to be executed directly against the datasource. In addition to being able to run any standard SQL command, use of this function allows a user to (potentially) utilize features specific to the datasource they are connected to that may not be available through ODBC. The ODBC driver will pass the specified command directly to the datasource.
\helpref{wxDb::GetData}{wxdbgetdata}, \helpref{wxDb::GetNext}{wxdbgetnext}
\helpref{wxDb::GetData}{wxdbgetdata}, \helpref{wxDb::GetNext}{wxdbgetnext}
+\membersection{wxDb::FwdOnlyCursors}\label{wxdbfwdonlycursors}
+
+\func{bool}{IsFwdOnlyCursors}{\void}
+
+Older form (pre-2.3/2.4 of wxWindows) of the
+\helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors}. This method is
+provided for backward compatability only. The method
+\helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors} should be
+used in place of this method.
+
+
+\func{wxDbInf *}{GetCatalog}{\param{const wxChar *}{userID}}
+
\membersection{wxDb::GetCatalog}\label{wxdbgetcatalog}
\func{wxDbInf *}{GetCatalog}{\param{const wxChar *}{userID}}
\membersection{wxDb::GetCatalog}\label{wxdbgetcatalog}
\func{wxDbInf *}{GetCatalog}{\param{const wxChar *}{userID}}
\docparam{tableName}{The table name you wish to obtain column information about.}
\docparam{tableName}{The table name you wish to obtain column information about.}
-\docparam{userID}{Name of the user that owns the table(s) (also referred to as schema). Required for some datasources for situations where there may be multiple tables with the same name in the datasource, but owned by different users. {\it userID} is evaluated in the following manner:}
+\docparam{userID}{Name of the user that owns the table(s) (also referred to as schema).
+Required for some datasources for situations where there may be multiple tables with the
+same name in the datasource, but owned by different users. {\it userID } is
+evaluated in the following manner:}
\begin{verbatim}
userID == NULL ... UserID is ignored (DEFAULT)
\begin{verbatim}
userID == NULL ... UserID is ignored (DEFAULT)
value.}
\docparam{cbReturned}{Pointer to the buffer containing the length of the
actual data returned. If this value comes back as SQL_NULL_DATA, then the
value.}
\docparam{cbReturned}{Pointer to the buffer containing the length of the
actual data returned. If this value comes back as SQL_NULL_DATA, then the
-wxDb::GetData() call has failed.}
+\helpref{wxDb::GetData}{wxdbgetdata} call has failed.}
\func{void}{SetDebugErrorMessages}{\param{bool }{state}}
\docparam{state}{Either TRUE (debug messages are logged) or FALSE (debug
\func{void}{SetDebugErrorMessages}{\param{bool }{state}}
\docparam{state}{Either TRUE (debug messages are logged) or FALSE (debug
-messages are not logged.}
+messages are not logged).}
-When called with {\it sqlLogON}, all commands sent to the datasource engine are logged to the file specified by {\it filename}. Logging is done by embedded riteSqlLog() calls in the database member functions, or may be manually logged by adding calls to \helpref{wxDb::WriteSqlLog}{wxdbwritesqllog} in your own source code.
+When called with {\it sqlLogON}, all commands sent to the datasource engine are logged to the file specified by {\it filename}. Logging is done by embedded \helpref{wxDb::WriteSqlLog}{wxdbwritesqllog} calls in the database member functions, or may be manually logged by adding calls to \helpref{wxDb::WriteSqlLog}{wxdbwritesqllog} in your own source code.
When called with {\it sqlLogOFF}, the logging file is closed, and any calls to \helpref{wxDb::WriteSqlLog}{wxdbwritesqllog} are ignored.
When called with {\it sqlLogOFF}, the logging file is closed, and any calls to \helpref{wxDb::WriteSqlLog}{wxdbwritesqllog} are ignored.
To access the nth column definition of your wxDbTable object, just reference
wxDbColDefs element [n - 1].
To access the nth column definition of your wxDbTable object, just reference
wxDbColDefs element [n - 1].
-Currently there are no member functions for this class.
-
Typically, \helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs} is used to
populate an array of these data structures for the wxDbTable instance.
Typically, \helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs} is used to
populate an array of these data structures for the wxDbTable instance.
+Currently there are no accessor functions for this class, so all members are
+public.
+
\begin{verbatim}
wxChar ColName[DB_MAX_COLUMN_NAME_LEN+1]; // Column Name
int DbDataType; - Logical Data Type;
\begin{verbatim}
wxChar ColName[DB_MAX_COLUMN_NAME_LEN+1]; // Column Name
int DbDataType; - Logical Data Type;
\helpref{wxDbTable::GetColDefs}{wxdbtablegetcoldefs}, \helpref{wxDb constructor}{wxdbconstr}
\helpref{wxDbTable::GetColDefs}{wxdbtablegetcoldefs}, \helpref{wxDb constructor}{wxdbconstr}
+\membersection{wxDbColDef::Initialize}\label{wxdbcoldefinitialize}
+
+Simply initializes all member variables to a cleared state. Called by
+the constructor automatically.
+
+
\section{\class{wxDbColInf}}\label{wxdbcolinf}
Used with the \helpref{wxDb::GetColumns}{wxdbgetcolumns} functions for obtaining all retrievable information about a column's definition.
\section{\class{wxDbColInf}}\label{wxdbcolinf}
Used with the \helpref{wxDb::GetColumns}{wxdbgetcolumns} functions for obtaining all retrievable information about a column's definition.
+\membersection{wxDbColInf::Initialize}\label{wxdbcolinfinitialize}
+
+Simply initializes all member variables to a cleared state. Called by
+the constructor automatically.
+
+
+
\section{\class{wxDbColFor}}\label{wxdbcolfor}
Beginning support for handling international formatting specifically on dates
\section{\class{wxDbColFor}}\label{wxdbcolfor}
Beginning support for handling international formatting specifically on dates
the constructor automatically.
the constructor automatically.
-\section{\class{wxDbIdxDef}}\label{wxdbidxdef}
-
-Used in creation of non-primary indexes. Currently there are no member
-functions for this class.
-
-\begin{verbatim}
- wxChar ColName[DB_MAX_COLUMN_NAME_LEN+1]
- // Name of column
- bool Ascending // Is index maintained in
- ASCENDING sequence?
-\end{verbatim}
-
-There are no constructors/destructors as of this time, and no member functions.
-
-
\section{\class{wxDbConnectInf}}\label{wxdbconnectinf}
This class is used for holding the data necessary for connecting to the ODBC
\section{\class{wxDbConnectInf}}\label{wxdbconnectinf}
This class is used for holding the data necessary for connecting to the ODBC
+\section{\class{wxDbIdxDef}}\label{wxdbidxdef}
+
+Used in creation of non-primary indexes. Currently there are no member
+functions for this class.
+
+\begin{verbatim}
+ wxChar ColName[DB_MAX_COLUMN_NAME_LEN+1]
+ // Name of column
+ bool Ascending // Is index maintained in
+ ASCENDING sequence?
+\end{verbatim}
+
+There are no constructors/destructors as of this time, and no member functions.
+
+
\section{\class{wxDbInf}}\label{wxdbinf}
Contains information regarding the database connection (datasource name,
\section{\class{wxDbInf}}\label{wxdbinf}
Contains information regarding the database connection (datasource name,
Constructs the full SQL statement that can be used to select all rows matching
the criteria in the pWhereClause. This function is called internally in the
Constructs the full SQL statement that can be used to select all rows matching
the criteria in the pWhereClause. This function is called internally in the
-wxDbTable class whenever the function \helpref{wxDbTable::Query}{wxdbtablequery}
+wxDbTable class whenever the function \helpref{wxDbTable::Query}{wxdbtablequery}
is called.
NOTE: Only the columns specified in \helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs}
is called.
NOTE: Only the columns specified in \helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs}
-\docparam{args}{{\it OPTIONAL}. This arguement allows the use of the
+\docparam{args}{{\it OPTIONAL}. This argument allows the use of the
DISTINCT keyword against a column name to cause the returned count to
only indicate the number of rows in the result set that have a unique
value in the specified column. An example is shown below. Default is "*",
DISTINCT keyword against a column name to cause the returned count to
only indicate the number of rows in the result set that have a unique
value in the specified column. An example is shown below. Default is "*",
-\helpref{wxDb::FwdOnlyCursors}{wxdbfwdonlycursors}
+\helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors}
\membersection{wxDbTable::GetFromClause}\label{wxdbtablegetfromclause}
\membersection{wxDbTable::GetFromClause}\label{wxdbtablegetfromclause}
-\helpref{wxDb::FwdOnlyCursors}{wxdbfwdonlycursors}
+\helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors}
\membersection{wxDbTable::GetNewCursor}\label{wxdbtablegetnewcursor}
\membersection{wxDbTable::GetNewCursor}\label{wxdbtablegetnewcursor}
-\helpref{wxDb::FwdOnlyCursors}{wxdbfwdonlycursors},
+\helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors},
\helpref{wxDbTable::--}{wxdbtableminusminus}
\helpref{wxDbTable::--}{wxdbtableminusminus}
This function is not being used within the ODBC class library and may be a
candidate for removal if no use is found for it.
This function is not being used within the ODBC class library and may be a
candidate for removal if no use is found for it.
-Row nuumber with some datasources/ODBC drivers is the position in the result set,
+Row number with some datasources/ODBC drivers is the position in the result set,
while in others it may be a physical position in the database. Check your
database documentation to find out which behavior is supported.
while in others it may be a physical position in the database. Check your
database documentation to find out which behavior is supported.
\docparam{colNo}{The column number of the bound column as defined by the
\helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs}
\docparam{colNo}{The column number of the bound column as defined by the
\helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs}
-calls which defined the columns accesible to this wxDbTable instance.}
+calls which defined the columns accessible to this wxDbTable instance.}
Accessor function to return information collected during the opening of the
datasource connection that is used by this wxDbTable instance. The result
Accessor function to return information collected during the opening of the
datasource connection that is used by this wxDbTable instance. The result
-returned by this function indicates whether an implicit closing of the curosr is
+returned by this function indicates whether an implicit closing of the cursor is
done after a commit on the database connection.
\wxheading{Return value}
done after a commit on the database connection.
\wxheading{Return value}
to maintain all information about the columns of a table in one memory
structure.
to maintain all information about the columns of a table in one memory
structure.
+Eventually, accessor functions will be added for this class
+
+
+\membersection{wxDbTableInf::Initialize}\label{wxdbtableinfinitialize}
+
+Simply initializes all member variables to a cleared state. Called by
+the constructor automatically.
at a time by using multiple wxRecordSets with a wxDatabase or you can make
your queries in sequential order using the same wxRecordSet.
at a time by using multiple wxRecordSets with a wxDatabase or you can make
your queries in sequential order using the same wxRecordSet.
-Note: this class is considered obsolete, replaced by the Remstar wxDB/wxTable classes
-(documented separately in Word and PDF format, as odbc.doc and odbc.pdf).
+Note: this class is considered obsolete, replaced by the Remstar
+wxDB/wxDbTable classes
\end{verbatim}
To allocate an environment handle for the ODBC connection to use, the
\end{verbatim}
To allocate an environment handle for the ODBC connection to use, the
-standard SQLAllocEnv() function is used.
+wxDbConnectInf class has a datasource independent method for creating
+the necessary handle:
\begin{verbatim}
if (DbConnectInf.AllocHenv())
\begin{verbatim}
if (DbConnectInf.AllocHenv())
-When the ::AllocHenv() function is called successfully, a value of
-TRUE will be returned. A value of FALSE means allocation failed, and
-the handle will be undefined.
+When the wxDbConnectInf::AllocHenv() function is called successfully, a
+value of TRUE will be returned. A value of FALSE means allocation failed,
+and the handle will be undefined.
A shorter form of doing the above steps is encapsulated into the
long form of the constructor for wxDbConnectInf.
A shorter form of doing the above steps is encapsulated into the
long form of the constructor for wxDbConnectInf.
\begin{verbatim}
wxDbConnectInf *DbConnectInf;
\begin{verbatim}
wxDbConnectInf *DbConnectInf;
\subsection{Database sample}\label{sampledb}
The database sample is a small test program showing how to use the ODBC
\subsection{Database sample}\label{sampledb}
The database sample is a small test program showing how to use the ODBC
-classes written by Remstar Intl. These classes are documented in a separate
-manual available from the wxWindows homepage. Obviously, this sample
-requires a database with ODBC support to be correctly installed on your
-system.
+classes written by Remstar Intl. Obviously, this sample requires a
+database with ODBC support to be correctly installed on your system.
\subsection{Dialogs sample}\label{sampledialogs}
\subsection{Dialogs sample}\label{sampledialogs}