available through the ODBC driver manager on the current workstation.
\begin{verbatim}
- wxStringList strList;
+ wxArrayString strArray;
while (wxDbGetDataSource(DbConnectInf.GetHenv(), Dsn, SQL_MAX_DSN_LENGTH+1, DsDesc, 255))
- strList.Add(Dsn);
+ strArray.Add(Dsn);
\end{verbatim}
\latexignore{\rtfignore{\wxheading{Members}}}
\func{bool}{ExecSql}{\param{const wxString \&}{pSqlStmt}}
+\func{bool}{ExecSql}{\param{const wxString \&}{pSqlStmt}, \param{wxDbColInf **}{columns}, \param{short \&}{numcols}}
+
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.
+To get column amount and column names or other information about returned columns, pass {\it 'columns'} and {\it 'numcols'} parameters to the function also.
+
\wxheading{Parameters}
\docparam{pSqlStmt}{Pointer to the SQL statement to be executed.}
+\docparam{columns}{On success, this function will set this pointer to point to array of \helpref{wxDbColInf}{wxdbcolinf} objects, holding information about columns returned by the query. You need to call delete[] for the pointer you pass here after you don't use it anymore to prevent memory leak.}
+
+\docparam{numcols}{Reference to variable where amount of objects in {\it 'columns'}-parameter will be set.}
+
\wxheading{Remarks}
This member extends the wxDb class and allows you to build and execute ANY VALID
\helpref{database classes overview}{odbcoverview},
\helpref{wxDbTable::GetColDefs}{wxdbtablegetcoldefs}, \helpref{wxDb constructor}{wxdbctor}
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
\membersection{wxDbColDef::Initialize}\label{wxdbcoldefinitialize}
Simply initializes all member variables to a cleared state. Called by
See the \helpref{database classes overview}{odbcoverview} for
an introduction to using the ODBC classes.
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
\membersection{wxDbColFor::Format}\label{wxdbcolforformat}
\func{int }{Format}{\param{int }{Nation}, \param{int }{dbDataType},
See the \helpref{database classes overview}{odbcoverview} for
an introduction to using the ODBC classes.
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
\membersection{wxDbColInf::Initialize}\label{wxdbcolinfinitialize}
Simply initializes all member variables to a cleared state. Called by
Accessor function to assign the user ID for this class instance.
-\section{\class{wxDbIndexDef}}\label{wxdbindexdef}
+\section{\class{wxDbIdxDef}}\label{wxdbidxdef}
Used in creation of non-primary indexes. Currently there are no member
functions for this class.
See the \helpref{database classes overview}{odbcoverview} for
an introduction to using the ODBC classes.
+
+\wxheading{Include files}
+
+<wx/db.h>
+
\section{\class{wxDbInf}}\label{wxdbinf}
Contains information regarding the database connection (datasource name,
See the \helpref{database classes overview}{odbcoverview} for
an introduction to using the ODBC classes.
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
\membersection{wxDbInf::Initialize}\label{wxdbinfinitialize}
Simply initializes all member variables to a cleared state. Called by
\begin{itemize}\itemsep=0pt
\item \helpref{wxDbColDef}{wxdbcoldef}
\item \helpref{wxDbColDataPtr}{wxdbcoldataptr}
-\item \helpref{wxDbIndexDef}{wxdbindexdef}
+\item \helpref{wxDbIdxDef}{wxdbidxdef}
\end{itemize}
\wxheading{Constants}
this function.
+\membersection{wxDbTable::BuildWhereClause}\label{wxdbtablebuildwhereclause}
+
+\func{void}{BuildWhereClause}{\param{wxString \&}{pWhereClause},
+\param{int }{typeOfWhere}, \param{const wxString \&}{qualTableName=""},
+\param{bool }{useLikeComparison=false}}
+
+Constructs the portion of a SQL statement which would follow the word 'WHERE'
+in a SQL statement to be passed to the datasource. The returned string
+does NOT include the word 'WHERE'.
+
+\wxheading{Parameters}
+
+\docparam{pWhereClause}{Pointer to storage for the SQL statement retrieved.
+To be sure you have adequate space allocated for the SQL statement, allocate
+DB\_MAX\_STATEMENT\_LEN bytes.}
+\docparam{typeOfWhere}{The type of where clause to generate. Can be one of
+two values: DB\_WHERE\_KEYFIELDS or DB\_WHERE\_MATCHING.}
+\docparam{qualTableName}{{\it OPTIONAL}. Prepended to all base table
+column names. For use when a FROM clause has been specified with the
+\helpref{wxDbTable::SetFromClause}{wxdbtablesetfromclause},
+to clarify which table a column name reference belongs to. Default is "".}
+\docparam{useLikeComparison}{{\it OPTIONAL}. Should the constructed WHERE
+clause utilize the LIKE comparison operator. If false, then the '='
+operator is used. Default is false.}
+
+\wxheading{Remarks}
+
+This member function allows you to see what the SQL WHERE clause looks like
+that the ODBC class library builds. This can be used for debugging purposes
+if you are having problems executing your own SQL statements.
+
+If using 'typeOfWhere' set to DB\_WHERE\_MATCHING, any bound columns currently
+containing a NULL value are not included in the WHERE clause's list of
+columns to use in the comparison.
+
+
\membersection{wxDbTable::CanSelectForUpdate}\label{wxdbtablecanselectforupdate}
\func{bool}{CanSelectForUpdate}{\void}
\membersection{wxDbTable::CreateIndex}\label{wxdbtablecreateindex}
\func{bool}{CreateIndex}{\param{const wxString \&}{IndexName}, \param{bool }{unique},
-\param{UWORD }{numIndexColumns}, \param{wxDbIndexDef *}{pIndexDefs},
+\param{UWORD }{numIndexColumns}, \param{wxDbIdxDef *}{pIndexDefs},
\param{bool }{attemptDrop=true}}
This member function allows you to create secondary (non primary) indexes on
space of the datasource.}
\docparam{unique}{Indicates if this index is unique.}
\docparam{numIndexColumns}{Number of columns in the index.}
-\docparam{pIndexDefs}{A pointer to an array \helpref{wxDbIndexDef}{wxdbindexdef} structures. }
+\docparam{pIndexDefs}{A pointer to an array \helpref{wxDbIdxDef}{wxdbidxdef} structures. }
\docparam{attemptDrop}{{\it OPTIONAL}. Indicates if the function should try
to execute a \helpref{wxDbTable::DropIndex}{wxdbtabledropindex} on the index
name provided before trying to create the index name. Default is true.}
number must match the number of columns defined in the 'pIndexDefs' parameter.
The fourth parameter specifies which columns make up the index using the
-\helpref{wxDbIndexDef}{wxdbindexdef} structure. For each column in the index, you must specify two
+\helpref{wxDbIdxDef}{wxdbidxdef} structure. For each column in the index, you must specify two
things, the column name and the sort order (ascending / descending). See
-the example below to see how to build and pass in the \helpref{wxDbIndexDef}{wxdbindexdef} structure.
+the example below to see how to build and pass in the \helpref{wxDbIdxDef}{wxdbidxdef} structure.
The fifth parameter is provided to handle the differences in datasources as
to whether they will automatically overwrite existing indexes with the same
\begin{verbatim}
// Create a secondary index on the PARTS table
- wxDbIndexDef IndexDef[2]; // 2 columns make up the index
+ wxDbIdxDef IndexDef[2]; // 2 columns make up the index
wxStrcpy(IndexDef[0].ColName, "PART_DESC"); // Column 1
IndexDef[0].Ascending = true;
\begin{verbatim}
...
// Base table is the "LOCATION" table, and it is being
- // outer joined to the "PART" table via the the field "PART_NUMBER"
+ // outer joined to the "PART" table via the field "PART_NUMBER"
// that can be related between the two tables.
location->SetWhereClause("LOCATION.PART_NUMBER = PART.PART_NUMBER")
location->SetFromClause("PART");
See the \helpref{database classes overview}{odbcoverview} for
an introduction to using the ODBC classes.
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
\membersection{wxDbTableInf::Initialize}\label{wxdbtableinfinitialize}
Simply initializes all member variables to a cleared state. Called by