Removed obsolete ODBC classes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2f8b6a1dcc
commit
f7292ebeba
@ -213,7 +213,6 @@ msgout.cpp Common Base
|
||||
mstream.cpp Common Base
|
||||
nbkbase.cpp Common
|
||||
object.cpp Common Base
|
||||
odbc.cpp Common NotGTK,NotX,NotOS2
|
||||
paper.cpp Common
|
||||
popupcmn.cpp Common
|
||||
prntbase.cpp Common
|
||||
@ -959,7 +958,6 @@ mslu.cpp MSW
|
||||
mstream.h WXH Base
|
||||
notebook.h WXH
|
||||
object.h WXH Base
|
||||
odbc.h WXH
|
||||
ownerdrw.h WXH
|
||||
palette.h WXH
|
||||
panel.h WXH
|
||||
|
@ -565,10 +565,8 @@ from specifications stored in an XML format.
|
||||
|
||||
\overview{Database classes overview}{odbcoverview}
|
||||
|
||||
wxWindows provides two alternative sets of classes for accessing Microsoft's ODBC (Open Database Connectivity)
|
||||
product. The new version by Remstar, known as wxODBC, is more powerful,
|
||||
portable, flexible and better supported, so please use the classes below for
|
||||
working with databases:
|
||||
wxWindows provides a set of classes for accessing Microsoft's ODBC (Open Database Connectivity)
|
||||
product, donated by Remstar. This is known as wxODBC.
|
||||
|
||||
\twocolwidtha{6cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
@ -584,17 +582,6 @@ working with databases:
|
||||
\twocolitem{\helpref{wxDbIdxDef}{wxdbidxdef}}{}
|
||||
\end{twocollist}
|
||||
|
||||
The documentation for the older classes is still included, but you should avoid
|
||||
using any of them in new programs:
|
||||
|
||||
\twocolwidtha{6cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{\helpref{wxDatabase}{wxdatabase}}{Database class}
|
||||
\twocolitem{\helpref{wxQueryCol}{wxquerycol}}{Class representing a column}
|
||||
\twocolitem{\helpref{wxQueryField}{wxqueryfield}}{Class representing a field}
|
||||
\twocolitem{\helpref{wxRecordSet}{wxrecordset}}{Class representing one or more record}
|
||||
\end{twocollist}
|
||||
|
||||
{\large {\bf Miscellaneous}}
|
||||
|
||||
\twocolwidtha{6cm}
|
||||
|
@ -53,7 +53,6 @@
|
||||
\input csconv.tex
|
||||
\input cursor.tex
|
||||
\input custdobj.tex
|
||||
\input database.tex
|
||||
\input dataform.tex
|
||||
\input datistrm.tex
|
||||
\input dataobj.tex
|
||||
@ -228,12 +227,10 @@
|
||||
\input progdlg.tex
|
||||
\input protocol.tex
|
||||
\input quantize.tex
|
||||
\input query.tex
|
||||
\input qylayevt.tex
|
||||
\input radiobox.tex
|
||||
\input radiobut.tex
|
||||
\input realpoin.tex
|
||||
\input recrdset.tex
|
||||
\input rect.tex
|
||||
\input regex.tex
|
||||
\input region.tex
|
||||
|
@ -1,29 +1,9 @@
|
||||
\section{Database classes overview}\label{odbcoverview}
|
||||
|
||||
\normalboxd{The more sophisticated wxODBC classes (wxDb/wxDbTable) are the
|
||||
recommended classes for doing database/ODBC work with wxWindows. These new
|
||||
classes replace the wxWindows v1.6x classes wxDatabase. Documentation for the
|
||||
old wxDatabase class and its associated classes is still
|
||||
included in the class documentation and in this overview section, but support
|
||||
for these old classes has been phased out, and all future development work
|
||||
is being done solely on the new wxDb/wxDbTable classes.}
|
||||
|
||||
\subsection{Different ODBC Class Libraries in wxWindows}
|
||||
|
||||
Following is a detailed overview of how to use the wxWindows ODBC classes - \helpref{wxDb}{wxdb}
|
||||
and \helpref{wxDbTable}{wxdbtable} and their associated functions. These are
|
||||
the ODBC classes donated by Remstar International, and are collectively
|
||||
referred to herein as the wxODBC classes. Since their initial inclusion with
|
||||
wxWindows v2.x, they have become the recommended wxWindows classes for database
|
||||
access.
|
||||
|
||||
An older version of some classes ported over from wxWindows v1.68 still exist
|
||||
(see \helpref{wxDatabase}{wxdatabase} in odbc.cpp), but are now deprecated in favor of the more
|
||||
robust and comprehensive wxDb/wxDbTable classes. All current and future
|
||||
feature development, as well as active debugging, are only being done on
|
||||
the wxODBC classes. Documentation for the older classes is still provided
|
||||
in this manual. The \helpref{wxDatabase overview}{wxdatabaseoverview} of the
|
||||
older classes follows the overview of the new classes.
|
||||
referred to herein as the wxODBC classes.
|
||||
|
||||
\subsection{wxDb/wxDbTable wxODBC Overview}\label{wxodbcoverview}
|
||||
|
||||
@ -1058,194 +1038,7 @@ delete DbConnectInf;
|
||||
|
||||
\end{verbatim}
|
||||
|
||||
\subsection{wxDatabase ODBC class overview [DEPRECATED]}\label{oldwxodbcoverview}
|
||||
|
||||
Classes: \helpref{wxDatabase}{wxdatabase}, \helpref{wxRecordSet}{wxrecordset}, \helpref{wxQueryCol}{wxquerycol},
|
||||
\rtfsp\helpref{wxQueryField}{wxqueryfield}
|
||||
|
||||
\normalboxd{The more sophisticated wxODBC classes (wxDb/wxDbTable) are the
|
||||
recommended classes for doing database/ODBC work with wxWindows. These new
|
||||
classes replace the wxWindows v1.6x classes wxDatabase.
|
||||
|
||||
Documentation for the old wxDatabase class and its associated classes is still
|
||||
included in the class documentation and in this overview section, but support
|
||||
for these old classes has been phased out, and all future development work
|
||||
is being done solely on the new wxDb/wxDbTable classes.}
|
||||
|
||||
wxWindows provides a set of classes for accessing a subset of Microsoft's ODBC (Open Database Connectivity)
|
||||
product. Currently, this wrapper is available under MS Windows only, although
|
||||
ODBC may appear on other platforms, and a generic or product-specific SQL emulator for the ODBC
|
||||
classes may be provided in wxWindows at a later date.
|
||||
|
||||
ODBC presents a unified API (Application Programmer's Interface) to a
|
||||
wide variety of databases, by interfacing indirectly to each database or
|
||||
file via an ODBC driver. The language for most of the database
|
||||
operations is SQL, so you need to learn a small amount of SQL as well as
|
||||
the wxWindows ODBC wrapper API. Even though the databases may not be
|
||||
SQL-based, the ODBC drivers translate SQL into appropriate operations
|
||||
for the database or file: even text files have rudimentary ODBC support,
|
||||
along with dBASE, Access, Excel and other file formats.
|
||||
|
||||
The run-time files for ODBC are bundled with many existing database
|
||||
packages, including MS Office. The required header files, sql.h and
|
||||
sqlext.h, are bundled with several compilers including MS VC++ and
|
||||
Watcom C++. The only other way to obtain these header files is from the
|
||||
ODBC SDK, which is only available with the MS Developer Network CD-ROMs
|
||||
-- at great expense. If you have odbc.dll, you can make the required
|
||||
import library odbc.lib using the tool `implib'. You need to have odbc.lib
|
||||
in your compiler library path.
|
||||
|
||||
The minimum you need to distribute with your application is odbc.dll, which must
|
||||
go in the Windows system directory. For the application to function correctly,
|
||||
ODBC drivers must be installed on the user's machine. If you do not use the database
|
||||
classes, odbc.dll will be loaded but not called (so ODBC does not need to be
|
||||
setup fully if no ODBC calls will be made).
|
||||
|
||||
A sample is distributed with wxWindows in {\tt samples/odbc}. You will need to install
|
||||
the sample dbf file as a data source using the ODBC setup utility, available from
|
||||
the control panel if ODBC has been fully installed.
|
||||
|
||||
\subsection{Procedures for writing an ODBC application using wxDatabase [DEPRECATED]}
|
||||
|
||||
You first need to create a wxDatabase object. If you want to get information
|
||||
from the ODBC manager instead of from a particular database (for example
|
||||
using \helpref{wxRecordSet::GetDataSources}{wxrecordsetgetdatasources}), then you
|
||||
do not need to call \helpref{wxDatabase::Open}{wxdatabaseopen}.
|
||||
If you do wish to connect to a datasource, then call wxDatabase::Open.
|
||||
You can reuse your wxDatabase object, calling wxDatabase::Close and wxDatabase::Open
|
||||
multiple times.
|
||||
|
||||
Then, create a wxRecordSet object for retrieving or sending information.
|
||||
For ODBC manager information retrieval, you can create it as a dynaset (retrieve the
|
||||
information as needed) or a snapshot (get all the data at once).
|
||||
If you are going to call \helpref{wxRecordSet::ExecuteSQL}{wxrecordsetexecutesql}, you need to create it as a snapshot.
|
||||
Dynaset mode is not yet implemented for user data.
|
||||
|
||||
Having called a function such as wxRecordSet::ExecuteSQL or
|
||||
wxRecordSet::GetDataSources, you may have a number of records
|
||||
associated with the recordset, if appropriate to the operation. You can
|
||||
now retrieve information such as the number of records retrieved and the
|
||||
actual data itself. Use \helpref{wxRecordSet::GetFieldData}{wxrecordsetgetfielddata} or
|
||||
\helpref{wxRecordSet::GetFieldDataPtr}{wxrecordsetgetfielddataptr} to get the data or a pointer to it, passing
|
||||
a column index or name. The data returned will be for the current
|
||||
record. To move around the records, use \helpref{wxRecordSet::MoveNext}{wxrecordsetmovenext},
|
||||
\rtfsp\helpref{wxRecordSet::MovePrev}{wxrecordsetmoveprev} and associated functions.
|
||||
|
||||
You can use the same recordset for multiple operations, or delete
|
||||
the recordset and create a new one.
|
||||
|
||||
Note that when you delete a wxDatabase, any associated recordsets
|
||||
also get deleted, so beware of holding onto invalid pointers.
|
||||
|
||||
\subsection{wxDatabase class overview [DEPRECATED]}\label{wxdatabaseoverview}
|
||||
|
||||
Class: \helpref{wxDatabase}{wxdatabase}
|
||||
|
||||
\wxheading{DEPRECATED}
|
||||
|
||||
Use \helpref{wxDb}{wxdb} and \helpref{wxDbTable}{wxdbtable} instead.
|
||||
|
||||
Every database object represents an ODBC connection. To do anything useful
|
||||
with a database object you need to bind a wxRecordSet object to it. All you
|
||||
can do with wxDatabase is opening/closing connections and getting some info
|
||||
about it (users, passwords, and so on).
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Database classes overview}{odbcoverview}
|
||||
|
||||
\subsection{wxQueryCol class overview [DEPRECATED]}\label{wxquerycoloverview}
|
||||
|
||||
Class: \helpref{wxQueryCol}{wxquerycol}
|
||||
|
||||
\wxheading{DEPRECATED}
|
||||
|
||||
Use \helpref{wxDb}{wxdb} and \helpref{wxDbTable}{wxdbtable} instead.
|
||||
|
||||
Every data column is represented by an instance of this class.
|
||||
It contains the name and type of a column and a list of wxQueryFields where
|
||||
the real data is stored. The links to user-defined variables are stored
|
||||
here, as well.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Database classes overview}{odbcoverview}
|
||||
|
||||
\subsection{wxQueryField class overview [DEPRECATED]}\label{wxqueryfieldoverview}
|
||||
|
||||
Class: \helpref{wxQueryField}{wxqueryfield}
|
||||
|
||||
\wxheading{DEPRECATED}
|
||||
|
||||
Use \helpref{wxDb}{wxdb} and \helpref{wxDbTable}{wxdbtable} instead.
|
||||
|
||||
As every data column is represented by an instance of the class wxQueryCol,
|
||||
every data item of a specific column is represented by an instance of
|
||||
wxQueryField. Each column contains a list of wxQueryFields. If wxRecordSet is
|
||||
of the type wxOPEN\_TYPE\_DYNASET, there will be only one field for each column,
|
||||
which will be updated every time you call functions like wxRecordSet::Move
|
||||
or wxRecordSet::GoTo. If wxRecordSet is of the type wxOPEN\_TYPE\_SNAPSHOT,
|
||||
all data returned by an ODBC function will be loaded at once and the number
|
||||
of wxQueryField instances for each column will depend on the number of records.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Database classes overview}{odbcoverview}
|
||||
|
||||
\subsection{wxRecordSet overview [DEPRECATED]}\label{wxrecordsetoverview}
|
||||
|
||||
Class: \helpref{wxRecordSet}{wxrecordset}
|
||||
|
||||
\wxheading{DEPRECATED}
|
||||
|
||||
Use \helpref{wxDb}{wxdb} and \helpref{wxDbTable}{wxdbtable} instead.
|
||||
|
||||
Each wxRecordSet represents a database query. You can make multiple queries
|
||||
at a time by using multiple wxRecordSets with a wxDatabase or you can make
|
||||
your queries in sequential order using the same wxRecordSet.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Database classes overview}{odbcoverview}
|
||||
|
||||
\subsection{ODBC SQL data types [DEPRECATED]}\label{sqltypes}
|
||||
|
||||
These are the data types supported in ODBC SQL. Note that there are other, extended level conformance
|
||||
types, not currently supported in wxWindows.
|
||||
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{CHAR(n)}{A character string of fixed length {\it n}.}
|
||||
\twocolitem{VARCHAR(n)}{A varying length character string of maximum length {\it n}.}
|
||||
\twocolitem{LONG VARCHAR(n)}{A varying length character string: equivalent to VARCHAR for the purposes
|
||||
of ODBC.}
|
||||
\twocolitem{DECIMAL(p, s)}{An exact numeric of precision {\it p} and scale {\it s}.}
|
||||
\twocolitem{NUMERIC(p, s)}{Same as DECIMAL.}
|
||||
\twocolitem{SMALLINT}{A 2 byte integer.}
|
||||
\twocolitem{INTEGER}{A 4 byte integer.}
|
||||
\twocolitem{REAL}{A 4 byte floating point number.}
|
||||
\twocolitem{FLOAT}{An 8 byte floating point number.}
|
||||
\twocolitem{DOUBLE PRECISION}{Same as FLOAT.}
|
||||
\end{twocollist}
|
||||
|
||||
These data types correspond to the following ODBC identifiers:
|
||||
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{SQL\_CHAR}{A character string of fixed length.}
|
||||
\twocolitem{SQL\_VARCHAR}{A varying length character string.}
|
||||
\twocolitem{SQL\_DECIMAL}{An exact numeric.}
|
||||
\twocolitem{SQL\_NUMERIC}{Same as SQL\_DECIMAL.}
|
||||
\twocolitem{SQL\_SMALLINT}{A 2 byte integer.}
|
||||
\twocolitem{SQL\_INTEGER}{A 4 byte integer.}
|
||||
\twocolitem{SQL\_REAL}{A 4 byte floating point number.}
|
||||
\twocolitem{SQL\_FLOAT}{An 8 byte floating point number.}
|
||||
\twocolitem{SQL\_DOUBLE}{Same as SQL\_FLOAT.}
|
||||
\end{twocollist}
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Database classes overview}{odbcoverview}
|
||||
|
||||
\subsection{A selection of SQL commands [DEPRECATED]}\label{sqlcommands}
|
||||
\subsection{A selection of SQL commands}\label{sqlcommands}
|
||||
|
||||
The following is a very brief description of some common SQL commands, with
|
||||
examples.
|
||||
|
@ -1,341 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: odbc.h
|
||||
// Purpose: ODBC classes
|
||||
// Author: Olaf Klein, Patrick Halke, Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Olaf Klein, Patrick Halke, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
#if wxUSE_ODBC
|
||||
|
||||
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||
#pragma interface "odbc.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WX_ODBCH__
|
||||
#define _WX_ODBCH__
|
||||
|
||||
//#ifdef __WXMSW__
|
||||
//#include <windows.h>
|
||||
//#endif
|
||||
|
||||
|
||||
#ifdef __UNIX__
|
||||
extern "C"
|
||||
{
|
||||
#include "wx/isql.h"
|
||||
#include "wx/isqlext.h"
|
||||
|
||||
typedef float SFLOAT;
|
||||
typedef double SDOUBLE;
|
||||
|
||||
#define ULONG UDWORD
|
||||
#define SQL_SQLSTATE_SIZE 5
|
||||
}
|
||||
#else // !Unix
|
||||
#include <sqlext.h>
|
||||
#endif // Unix/!Unix
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
typedef RETCODE wxRETCODE;
|
||||
|
||||
// Recordset open types
|
||||
#define wxOPEN_TYPE_DYNASET 1
|
||||
#define wxOPEN_TYPE_SNAPSHOT 2
|
||||
#define wxOPEN_TYPE_FORWARD_ONLY 3
|
||||
|
||||
// Recordset open options
|
||||
#define wxOPTION_DEFAULT 1
|
||||
#define wxOPTION_APPEND_ONLY 2
|
||||
#define wxOPTION_READ_ONLY 3
|
||||
|
||||
// Data types
|
||||
class WXDLLEXPORT wxRecordSet;
|
||||
|
||||
class WXDLLEXPORT wxDatabase: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDatabase)
|
||||
protected:
|
||||
static HENV hEnv;
|
||||
static int refCount;
|
||||
|
||||
HDBC hDBC;
|
||||
char* username;
|
||||
char* password;
|
||||
char* datasource;
|
||||
char* dbname;
|
||||
char* connectstring;
|
||||
bool isOpen;
|
||||
|
||||
// error-handling variables
|
||||
wxRETCODE retcode;
|
||||
char sqlstate[SQL_SQLSTATE_SIZE+1]; // error class and subclass
|
||||
char errmsg[SQL_MAX_MESSAGE_LENGTH]; // error message
|
||||
long nat_err; // error number by ODBC driver
|
||||
bool err_occured;
|
||||
|
||||
wxList recordSets; // Record sets: Added by JACS
|
||||
|
||||
public:
|
||||
wxDatabase();
|
||||
~wxDatabase();
|
||||
|
||||
bool Open(char *, bool exclusive =FALSE, bool readOnly =TRUE, char *username ="ODBC", char *password ="");
|
||||
bool Close();
|
||||
|
||||
// Cleanup operations, added by JACS
|
||||
void DeleteRecordSets(void); // Called when the database is deleted
|
||||
void ResetRecordSets(void); // Required if the database is closed
|
||||
inline wxList& GetRecordSets(void) { return recordSets; }
|
||||
|
||||
inline char *GetUsername(void) { return username; }
|
||||
inline char *GetPassword(void) { return password; }
|
||||
inline char *GetDataSource(void) { return datasource; }
|
||||
inline bool IsOpen(void) { return isOpen; }
|
||||
inline wxRETCODE GetErrorCode(void) { return retcode; }
|
||||
inline HDBC GetHDBC(void) { return hDBC; }
|
||||
inline HENV GetHENV(void) { return hEnv; }
|
||||
|
||||
void SetPassword(char *s);
|
||||
void SetUsername(char *s);
|
||||
void SetDataSource(char *s);
|
||||
|
||||
// Database attributes
|
||||
char *GetDatabaseName();
|
||||
bool CanUpdate();
|
||||
bool CanTransact();
|
||||
bool InWaitForDataSource();
|
||||
void SetLoginTimeout(long seconds);
|
||||
void SetQueryTimeout(long seconds);
|
||||
void SetSynchronousMode(bool synchronous);
|
||||
|
||||
// Database operations
|
||||
bool BeginTrans();
|
||||
bool CommitTrans();
|
||||
bool RollbackTrans();
|
||||
void Cancel();
|
||||
|
||||
// Error handling
|
||||
bool ErrorOccured();
|
||||
char* GetErrorMessage();
|
||||
long GetErrorNumber();
|
||||
char* GetErrorClass();
|
||||
inline void ErrorSnapshot(HSTMT =SQL_NULL_HSTMT);
|
||||
|
||||
// Overridables
|
||||
virtual void OnSetOptions(wxRecordSet *recordSet);
|
||||
virtual void OnWaitForDataSource(bool stillExecuting);
|
||||
|
||||
bool GetInfo(long infoType, long *buf);
|
||||
bool GetInfo(long infoType, char *buf, int bufSize = -1);
|
||||
|
||||
// implementation = TRUE means get the DLL version.
|
||||
// Otherwise, returns header file version.
|
||||
wxString GetODBCVersionString(bool implementation = TRUE);
|
||||
float GetODBCVersionFloat(bool implementation = TRUE);
|
||||
};
|
||||
|
||||
// Represents a data row
|
||||
class WXDLLEXPORT wxQueryField: public wxObject
|
||||
{
|
||||
// JACS
|
||||
DECLARE_DYNAMIC_CLASS(wxQueryField)
|
||||
private:
|
||||
void *data;
|
||||
short type;
|
||||
long size;
|
||||
bool dirty;
|
||||
|
||||
bool AllocData();
|
||||
|
||||
public:
|
||||
wxQueryField();
|
||||
~wxQueryField();
|
||||
|
||||
bool SetData(void*, long);
|
||||
void SetDirty(bool =TRUE);
|
||||
void ClearData();
|
||||
void SetType(short);
|
||||
void SetSize(long);
|
||||
|
||||
void* GetData();
|
||||
short GetType();
|
||||
long GetSize();
|
||||
|
||||
bool IsDirty();
|
||||
};
|
||||
|
||||
// Represents a column description
|
||||
class WXDLLEXPORT wxQueryCol: public wxObject
|
||||
{
|
||||
// JACS
|
||||
DECLARE_DYNAMIC_CLASS(wxQueryCol)
|
||||
private:
|
||||
short type;
|
||||
char *name;
|
||||
bool nullable;
|
||||
long varsize;
|
||||
void* var;
|
||||
|
||||
public:
|
||||
wxList fields;
|
||||
|
||||
wxQueryCol();
|
||||
~wxQueryCol();
|
||||
|
||||
void* BindVar(void*, long);
|
||||
void FillVar(int);
|
||||
void AppendField(void*, long);
|
||||
bool SetData(int, void*, long);
|
||||
void SetName(char*);
|
||||
void SetNullable(bool);
|
||||
void SetFieldDirty(int, bool =TRUE);
|
||||
void SetType(short);
|
||||
|
||||
char* GetName();
|
||||
short GetType();
|
||||
bool IsNullable();
|
||||
void* GetData(int);
|
||||
long GetSize(int);
|
||||
|
||||
bool IsFieldDirty(int);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxRecordSet: public wxObject
|
||||
{
|
||||
// JACS
|
||||
DECLARE_DYNAMIC_CLASS(wxRecordSet)
|
||||
private:
|
||||
int cursor;
|
||||
int type;
|
||||
int options;
|
||||
|
||||
protected:
|
||||
HSTMT hStmt;
|
||||
int nFields;
|
||||
int nParams;
|
||||
int nRecords;
|
||||
short nCols;
|
||||
char *recordFilter;
|
||||
char *sortString;
|
||||
char *defaultSQL;
|
||||
char* tablename;
|
||||
wxDatabase *parentdb;
|
||||
wxRETCODE retcode;
|
||||
wxList cols;
|
||||
wxList fetchbuf;
|
||||
|
||||
void FillVars(int);
|
||||
|
||||
public:
|
||||
// JACS gave parent a default value for benefit of IMPLEMENT_DYNAMIC_CLASS
|
||||
wxRecordSet(wxDatabase *parent = NULL,
|
||||
int = wxOPEN_TYPE_DYNASET,
|
||||
int = wxOPTION_DEFAULT);
|
||||
~wxRecordSet();
|
||||
|
||||
// My own, lower-level functions.
|
||||
bool BeginQuery(int openType, char *sql = NULL, int options = wxOPTION_DEFAULT);
|
||||
bool EndQuery();
|
||||
bool Query(char* columns, char* table =NULL, char *filter =NULL);
|
||||
|
||||
// Attributes
|
||||
inline int GetNumberFields(void) { return nFields; }
|
||||
inline int GetNumberParams(void) { return nParams; }
|
||||
long GetNumberRecords();
|
||||
long GetNumberCols();
|
||||
inline char *GetFilter(void) { return recordFilter; }
|
||||
inline char *GetSortString(void) { return sortString; }
|
||||
inline wxDatabase *GetDatabase(void) { return parentdb; }
|
||||
inline wxRETCODE GetErrorCode(void) { return retcode; }
|
||||
bool CanAppend();
|
||||
bool CanRestart();
|
||||
bool CanScroll();
|
||||
bool CanTransact();
|
||||
bool CanUpdate();
|
||||
long GetCurrentRecord();
|
||||
bool RecordCountFinal();
|
||||
bool GetResultSet();
|
||||
bool ExecuteSQL(char*);
|
||||
bool GetTables();
|
||||
bool GetColumns(char* =NULL);
|
||||
bool GetPrimaryKeys(char* =NULL);
|
||||
bool GetForeignKeys(char* , char * );
|
||||
char *GetTableName();
|
||||
void SetTableName(char*);
|
||||
char *GetSQL();
|
||||
bool IsOpen();
|
||||
bool IsBOF();
|
||||
bool IsEOF();
|
||||
bool IsDeleted();
|
||||
|
||||
bool GetFieldData(int colPos, int dataType, void *dataPtr);
|
||||
bool GetFieldData(const char*, int dataType, void *dataPtr);
|
||||
void* GetFieldDataPtr(int, int);
|
||||
void* GetFieldDataPtr(const char*, int);
|
||||
char* GetColName(int);
|
||||
short GetColType(int);
|
||||
short GetColType(const char*);
|
||||
void* BindVar(int, void*, long);
|
||||
void* BindVar(const char*, void*, long);
|
||||
|
||||
void SetType(int);
|
||||
int GetType();
|
||||
void SetOptions(int);
|
||||
int GetOptions();
|
||||
|
||||
// Update operations
|
||||
void AddNew();
|
||||
bool Delete();
|
||||
void Edit();
|
||||
bool Update();
|
||||
|
||||
// Record navigation
|
||||
virtual bool Move(long rows);
|
||||
virtual bool MoveFirst();
|
||||
virtual bool MoveLast();
|
||||
virtual bool MoveNext();
|
||||
virtual bool MovePrev();
|
||||
virtual bool GoTo(long);
|
||||
|
||||
// Others
|
||||
bool GetDataSources();
|
||||
|
||||
// Associate a column name/position with a data location
|
||||
// bool BindColumn(int colPos, int dataType, void *dataPtr);
|
||||
|
||||
void Cancel();
|
||||
bool IsFieldDirty(int);
|
||||
bool IsFieldDirty(const char*);
|
||||
bool IsFieldNull(int);
|
||||
bool IsFieldNull(const char*);
|
||||
bool IsColNullable(int);
|
||||
bool IsColNullable(const char*);
|
||||
virtual bool Requery();
|
||||
virtual void SetFieldDirty(int, bool dirty = TRUE);
|
||||
virtual void SetFieldDirty(const char*, bool dirty = TRUE);
|
||||
void SetFieldNull(void *p, bool isNull = TRUE);
|
||||
|
||||
// Overridables
|
||||
virtual char *GetDefaultConnect();
|
||||
virtual char *GetDefaultSQL();
|
||||
|
||||
// Internal
|
||||
|
||||
// Build SQL query from column specification
|
||||
bool ConstructDefaultSQL();
|
||||
void SetDefaultSQL(char *s);
|
||||
bool ReleaseHandle(void); // Added JACS
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_ODBC
|
@ -139,7 +139,6 @@ ALL_SOURCES = \
|
||||
common/mstream.cpp \
|
||||
common/nbkbase.cpp \
|
||||
common/object.cpp \
|
||||
common/odbc.cpp \
|
||||
common/paper.cpp \
|
||||
common/popupcmn.cpp \
|
||||
common/prntbase.cpp \
|
||||
@ -297,7 +296,6 @@ ALL_HEADERS = \
|
||||
ctrlsub.h \
|
||||
cursor.h \
|
||||
dataobj.h \
|
||||
date.h \
|
||||
datetime.h \
|
||||
datetime.inl \
|
||||
datstrm.h \
|
||||
@ -412,7 +410,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
@ -471,7 +468,6 @@ ALL_HEADERS = \
|
||||
tglbtn.h \
|
||||
thread.h \
|
||||
thrimpl.cpp \
|
||||
time.h \
|
||||
timer.h \
|
||||
tipdlg.h \
|
||||
tipwin.h \
|
||||
@ -703,7 +699,6 @@ COMMONOBJS = \
|
||||
mstream.o \
|
||||
nbkbase.o \
|
||||
object.o \
|
||||
odbc.o \
|
||||
paper.o \
|
||||
popupcmn.o \
|
||||
prntbase.o \
|
||||
|
1840
src/common/odbc.cpp
1840
src/common/odbc.cpp
File diff suppressed because it is too large
Load Diff
@ -424,7 +424,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
|
@ -424,7 +424,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
|
@ -132,7 +132,6 @@ ALL_SOURCES = \
|
||||
common/mstream.cpp \
|
||||
common/nbkbase.cpp \
|
||||
common/object.cpp \
|
||||
common/odbc.cpp \
|
||||
common/paper.cpp \
|
||||
common/popupcmn.cpp \
|
||||
common/prntbase.cpp \
|
||||
@ -314,7 +313,6 @@ ALL_HEADERS = \
|
||||
ctrlsub.h \
|
||||
cursor.h \
|
||||
dataobj.h \
|
||||
date.h \
|
||||
datetime.h \
|
||||
datetime.inl \
|
||||
datstrm.h \
|
||||
@ -429,7 +427,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
@ -489,7 +486,6 @@ ALL_HEADERS = \
|
||||
tglbtn.h \
|
||||
thread.h \
|
||||
thrimpl.cpp \
|
||||
time.h \
|
||||
timer.h \
|
||||
tipdlg.h \
|
||||
tipwin.h \
|
||||
@ -759,7 +755,6 @@ COMMONOBJS = \
|
||||
mstream.o \
|
||||
nbkbase.o \
|
||||
object.o \
|
||||
odbc.o \
|
||||
paper.o \
|
||||
popupcmn.o \
|
||||
prntbase.o \
|
||||
|
@ -132,7 +132,6 @@ ALL_SOURCES = \
|
||||
common/mstream.cpp \
|
||||
common/nbkbase.cpp \
|
||||
common/object.cpp \
|
||||
common/odbc.cpp \
|
||||
common/paper.cpp \
|
||||
common/popupcmn.cpp \
|
||||
common/prntbase.cpp \
|
||||
@ -314,7 +313,6 @@ ALL_HEADERS = \
|
||||
ctrlsub.h \
|
||||
cursor.h \
|
||||
dataobj.h \
|
||||
date.h \
|
||||
datetime.h \
|
||||
datetime.inl \
|
||||
datstrm.h \
|
||||
@ -429,7 +427,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
@ -489,7 +486,6 @@ ALL_HEADERS = \
|
||||
tglbtn.h \
|
||||
thread.h \
|
||||
thrimpl.cpp \
|
||||
time.h \
|
||||
timer.h \
|
||||
tipdlg.h \
|
||||
tipwin.h \
|
||||
@ -759,7 +755,6 @@ COMMONOBJS = \
|
||||
mstream.o \
|
||||
nbkbase.o \
|
||||
object.o \
|
||||
odbc.o \
|
||||
paper.o \
|
||||
popupcmn.o \
|
||||
prntbase.o \
|
||||
|
@ -420,7 +420,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
|
@ -119,7 +119,6 @@ ALL_SOURCES = \
|
||||
common/mstream.cpp \
|
||||
common/nbkbase.cpp \
|
||||
common/object.cpp \
|
||||
common/odbc.cpp \
|
||||
common/paper.cpp \
|
||||
common/popupcmn.cpp \
|
||||
common/prntbase.cpp \
|
||||
@ -446,7 +445,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
@ -794,7 +792,6 @@ COMMONOBJS = \
|
||||
mstream.o \
|
||||
nbkbase.o \
|
||||
object.o \
|
||||
odbc.o \
|
||||
paper.o \
|
||||
popupcmn.o \
|
||||
prntbase.o \
|
||||
|
@ -471,7 +471,6 @@ COMMONOBJS = \
|
||||
$(MSWDIR)\mstream.obj \
|
||||
$(MSWDIR)\nbkbase.obj \
|
||||
$(MSWDIR)\object.obj \
|
||||
$(MSWDIR)\odbc.obj \
|
||||
$(MSWDIR)\paper.obj \
|
||||
$(MSWDIR)\popupcmn.obj \
|
||||
$(MSWDIR)\prntbase.obj \
|
||||
@ -1208,8 +1207,6 @@ $(MSWDIR)\nbkbase.obj: $(COMMDIR)\nbkbase.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\object.obj: $(COMMDIR)\object.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\odbc.obj: $(COMMDIR)\odbc.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\paper.obj: $(COMMDIR)\paper.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\popupcmn.obj: $(COMMDIR)\popupcmn.$(SRCSUFF)
|
||||
|
@ -167,8 +167,7 @@ COMMONOBJS1 = \
|
||||
$(COMMDIR)\msgout.obj \
|
||||
$(COMMDIR)\mstream.obj \
|
||||
$(COMMDIR)\nbkbase.obj \
|
||||
$(COMMDIR)\object.obj \
|
||||
$(COMMDIR)\odbc.obj
|
||||
$(COMMDIR)\object.obj
|
||||
|
||||
COMMONOBJS2 = \
|
||||
$(COMMDIR)\paper.obj \
|
||||
@ -1177,11 +1176,6 @@ $(COMMDIR)/object.obj: $*.$(SRCSUFF)
|
||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(COMMDIR)/odbc.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(COMMDIR)/paper.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||
|
@ -383,7 +383,6 @@ ADVANCEDOBJS_BASE = \
|
||||
|
||||
ADVANCEDOBJS = \
|
||||
$(ADVANCEDOBJS_BASE) \
|
||||
$(COMMDIR)/odbc.$(OBJSUFF) \
|
||||
$(MSWDIR)/ole/access.$(OBJSUFF) \
|
||||
$(MSWDIR)/ole/automtn.$(OBJSUFF) \
|
||||
$(MSWDIR)/ole/dataobj.$(OBJSUFF) \
|
||||
|
@ -1,4 +1,4 @@
|
||||
; Last change: JS 23 Mar 103 3:25 pm
|
||||
; Last change: JS 23 Mar 103 8:02 pm
|
||||
|
||||
|
||||
# This file was automatically generated by tmake
|
||||
@ -147,7 +147,6 @@ COMMONOBJS = \
|
||||
$(COMMDIR)\mstream.obj \
|
||||
$(COMMDIR)\nbkbase.obj \
|
||||
$(COMMDIR)\object.obj \
|
||||
$(COMMDIR)\odbc.obj \
|
||||
$(COMMDIR)\paper.obj \
|
||||
$(COMMDIR)\popupcmn.obj \
|
||||
$(COMMDIR)\prntbase.obj \
|
||||
|
@ -104,7 +104,6 @@ COMMONOBJS = cmndata.obj \
|
||||
|
||||
# Can't compile these yet under Salford C++
|
||||
# mimetype.obj \
|
||||
# odbc.obj \
|
||||
# db.obj \
|
||||
# dbtable.obj \
|
||||
|
||||
@ -579,9 +578,6 @@ module.obj: $(COMMDIR)\module.cpp
|
||||
object.obj: $(COMMDIR)\object.cpp
|
||||
$(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\object.cpp /BINARY object.obj
|
||||
|
||||
odbc.obj: $(COMMDIR)\odbc.cpp
|
||||
$(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\odbc.cpp /BINARY odbc.obj
|
||||
|
||||
prntbase.obj: $(COMMDIR)\prntbase.cpp
|
||||
$(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\prntbase.cpp /BINARY prntbase.obj
|
||||
|
||||
|
@ -104,7 +104,6 @@ COMMONOBJS = \
|
||||
$(COMMDIR)/module.$(OBJSUFF) \
|
||||
$(COMMDIR)/mimetype.$(OBJSUFF) \
|
||||
$(COMMDIR)/object.$(OBJSUFF) \
|
||||
$(COMMDIR)/odbc.$(OBJSUFF) \
|
||||
$(COMMDIR)/process.$(OBJSUFF) \
|
||||
$(COMMDIR)/prntbase.$(OBJSUFF) \
|
||||
$(COMMDIR)/resource.$(OBJSUFF) \
|
||||
|
@ -224,7 +224,6 @@ COMMONOBJS = \
|
||||
$(COMMDIR)\$D\mstream.obj \
|
||||
$(COMMDIR)\$D\nbkbase.obj \
|
||||
$(COMMDIR)\$D\object.obj \
|
||||
$(COMMDIR)\$D\odbc.obj \
|
||||
$(COMMDIR)\$D\paper.obj \
|
||||
$(COMMDIR)\$D\popupcmn.obj \
|
||||
$(COMMDIR)\$D\prntbase.obj \
|
||||
|
@ -169,7 +169,6 @@ COMMONOBJS = &
|
||||
$(OUTPUTDIR)\mstream.obj &
|
||||
$(OUTPUTDIR)\nbkbase.obj &
|
||||
$(OUTPUTDIR)\object.obj &
|
||||
$(OUTPUTDIR)\odbc.obj &
|
||||
$(OUTPUTDIR)\paper.obj &
|
||||
$(OUTPUTDIR)\popupcmn.obj &
|
||||
$(OUTPUTDIR)\prntbase.obj &
|
||||
@ -976,9 +975,6 @@ $(OUTPUTDIR)\nbkbase.obj: $(COMMDIR)\nbkbase.cpp
|
||||
$(OUTPUTDIR)\object.obj: $(COMMDIR)\object.cpp
|
||||
*$(CXX) $(CXXFLAGS) $<
|
||||
|
||||
$(OUTPUTDIR)\odbc.obj: $(COMMDIR)\odbc.cpp
|
||||
*$(CXX) $(CXXFLAGS) $<
|
||||
|
||||
$(OUTPUTDIR)\paper.obj: $(COMMDIR)\paper.cpp
|
||||
*$(CXX) $(CXXFLAGS) $<
|
||||
|
||||
|
@ -307,7 +307,6 @@ ALL_HEADERS = \
|
||||
ctrlsub.h \
|
||||
cursor.h \
|
||||
dataobj.h \
|
||||
date.h \
|
||||
datetime.h \
|
||||
datetime.inl \
|
||||
datstrm.h \
|
||||
@ -422,7 +421,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
@ -482,7 +480,6 @@ ALL_HEADERS = \
|
||||
tglbtn.h \
|
||||
thread.h \
|
||||
thrimpl.cpp \
|
||||
time.h \
|
||||
timer.h \
|
||||
tipdlg.h \
|
||||
tipwin.h \
|
||||
|
@ -167,7 +167,6 @@ ALL_SOURCES = \
|
||||
common/mstream.cpp \
|
||||
common/nbkbase.cpp \
|
||||
common/object.cpp \
|
||||
common/odbc.cpp \
|
||||
common/paper.cpp \
|
||||
common/popupcmn.cpp \
|
||||
common/prntbase.cpp \
|
||||
@ -394,7 +393,6 @@ ALL_HEADERS = \
|
||||
mstream.h \
|
||||
notebook.h \
|
||||
object.h \
|
||||
odbc.h \
|
||||
ownerdrw.h \
|
||||
palette.h \
|
||||
panel.h \
|
||||
@ -743,7 +741,6 @@ COMMONOBJS = \
|
||||
mstream.o \
|
||||
nbkbase.o \
|
||||
object.o \
|
||||
odbc.o \
|
||||
paper.o \
|
||||
popupcmn.o \
|
||||
prntbase.o \
|
||||
|
Loading…
Reference in New Issue
Block a user