X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/684761db46d96d4a919d8e94edd1e9065978e675..c65650d7b5472d00da0a0516ff1a2ccf53746319:/docs/latex/wx/db.tex diff --git a/docs/latex/wx/db.tex b/docs/latex/wx/db.tex index c30477bb89..6b6de80bbe 100644 --- a/docs/latex/wx/db.tex +++ b/docs/latex/wx/db.tex @@ -254,8 +254,8 @@ ODBC errors.} \wxheading{Remarks} Default cursor scrolling is defined by wxODBC\_FWD\_ONLY\_CURSORS in setup.h -when the wxWindows library is built. This behavior can be overridden when -an instance of a wxDb is created (see \helpref{wxDb constructor}{wxdbconstr}). +when the wxWidgets library is built. This behavior can be overridden when +an instance of a wxDb is created (see \helpref{wxDb constructor}{wxdbctor}). Default setting of this value true, as not all databases/drivers support both types of cursors. @@ -319,7 +319,7 @@ This function is used to request a "new" wxDb instance for use by the program. The wxDb instance returned is also opened (see \helpref{wxDb::Open}{wxdbopen}). This function (along with wxDbFreeConnection() and wxDbCloseConnection()) -maintain a cached of wxDb instances for user/re-use by a program. When a +maintain a cache of wxDb instances for user/re-use by a program. When a program needs a wxDb instance, it may call this function to obtain a wxDb instance. If there is a wxDb instance in the cache that is currently unused that matches the connection requirements specified in {\it'pDbConfig'} then @@ -355,7 +355,7 @@ cached connections created by calls to wxDbGetConnection(). \func{const wxChar *}{wxDbLogExtendedErrorMsg}{\param{const wxChar *}{userText}, \param{wxDb *}{pDb}, \param{wxChar *}{ErrFile}, \param{int }{ErrLine}} Writes a message to the wxLog window (stdout usually) when an internal -error situation occurs. This function only works in DEBUG builds +error situation occurs. \func{bool}{wxDbSqlLog}{\param{wxDbSqlLogState }{state}, \param{const wxString \&}{filename = SQL\_LOG\_FILENAME}} @@ -380,7 +380,7 @@ available through the ODBC driver manager on the current workstation. \latexignore{\rtfignore{\wxheading{Members}}} -\membersection{wxDb::wxDb}\label{wxdbconstr} +\membersection{wxDb::wxDb}\label{wxdbctor} \func{}{wxDb}{\void} @@ -596,7 +596,7 @@ Possible values returned by this function can be viewed in the \helpref{Enumerated types}{wxdbenumeratedtypes} section of wxDb. There are known issues with conformance to the ODBC standards with several -datasources supported by the wxWindows ODBC classes. Please see the overview +datasources supported by the wxWidgets ODBC classes. Please see the overview for specific details on which datasource have which issues. \wxheading{Return value} @@ -731,7 +731,7 @@ of processing. \func{bool}{IsFwdOnlyCursors}{\void} -Older form (pre-2.3/2.4 of wxWindows) of the +Older form (pre-2.3/2.4 of wxWidgets) of the \helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors}. This method is provided for backward compatibility only. The method \helpref{wxDb::IsFwdOnlyCursors}{wxdbisfwdonlycursors} should be @@ -1083,7 +1083,7 @@ The default setting of whether a wxDb connection to a database allows forward-only or also backward scrolling cursors is defined in setup.h by the value of wxODBC\_FWD\_ONLY\_CURSORS. This default setting can be overridden when the wxDb connection is initially created (see -\helpref{wxDb constructor}{wxdbconstr} and \helpref{wxDbGetConnection}{wxdbfunctions}). +\helpref{wxDb constructor}{wxdbctor} and \helpref{wxDbGetConnection}{wxdbfunctions}). \wxheading{Return value} @@ -1093,17 +1093,17 @@ use backward scrolling cursors and their associated functions (see note above). \wxheading{Remarks} -Added as of wxWindows v2.4 release, this function is a renamed version of -wxDb::FwdOnlyCursors() to match the normal wxWindows naming conventions for +Added as of wxWidgets v2.4 release, this function is a renamed version of +wxDb::FwdOnlyCursors() to match the normal wxWidgets naming conventions for class member functions. This function is not available in versions prior to v2.4. You should -use \helpref{wxDb::FwdOnlyCursors}{wxdbfwdonlycursors} for wxWindows +use \helpref{wxDb::FwdOnlyCursors}{wxdbfwdonlycursors} for wxWidgets versions prior to 2.4. \wxheading{See also} -\helpref{wxDb constructor}{wxdbconstr}, \helpref{wxDbGetConnection}{wxdbfunctions} +\helpref{wxDb constructor}{wxdbctor}, \helpref{wxDbGetConnection}{wxdbfunctions} \membersection{wxDb::IsOpen}\label{wxdbisopen} @@ -1185,7 +1185,13 @@ used for behavioral descriptions. \membersection{wxDb::Open}\label{wxdbopen} \func{bool}{Open}{\param{const wxString \&}{Dsn}, \param{const wxString \&}{Uid}, -\param{const wxString \&}{AuthStr}} +\param{const wxString \&}{AuthStr}, \param{bool }{failOnDataTypeUnsupported}} + +\func{bool}{Open}{\param{const wxString \&}{inConnectStr}, +\param{bool }{failOnDataTypeUnsupported}} + +\func{bool}{Open}{\param{wxDbConnectInf *}{dbConnectInf}, +\param{bool }{failOnDataTypeUnsupported}} \func{bool}{Open}{\param{wxDb *}{copyDb}} @@ -1222,9 +1228,25 @@ Privileges include being able to create new objects, update objects, delete objects and so on. Users and privileges are normally administered by the database administrator.} \docparam{AuthStr}{The password associated with the Uid.} -\docparam{copyDb}{Already completely configured and opened datasource connection -from which all Dsn, Uid, AuthStr, and data typing information is to be copied -from for use by this datasource connection.} +\docparam{failOnDataTypeUnsupporte}{As part of connecting to a database, the +wxDb::Open() function will query the database to find out the native types +that it supports. With some databases, some data types may not be supported, +or not sufficiently supported, for use with the wxODBC classes. Normally +a program should fail in this case, so as not to try to use a data type +that is not supported. This parameter allows the programmer to override the +failure if they wish and continue on using the connection.} +\docparam{dbConnectInf}{Contains a DSN, Uid, Password, or a connection string +to be used in opening a new connection to the database. If a connection +string is present, then the connection string will be used. If there is no +connection string present, then the DSN, Uid, and Password are used.} +\docparam{inConnectStr}{A valid ODBC connection string used to connect to a +database} +\docparam{copyDb}{Already completely configured and opened datasource +connection from which all Dsn, Uid, AuthStr, connection string, and data +typing information is to be copied from for use by this datasource +connection. If 'copyDb' used a connection string to create its connection +originally, then the connection being made by this call to wxDb::Open() will +use that same connection string.} \wxheading{Remarks} @@ -1313,7 +1335,7 @@ When compiled in release mode (FINAL=1), this setting has no affect. \wxheading{See also} -\helpref{wxDb constructor}{wxdbconstr} +\helpref{wxDb constructor}{wxdbctor} \membersection{wxDb::SetSqlLogging}\label{wxdbsetsqllogging} @@ -1543,7 +1565,7 @@ This class is used to hold information about the columns bound to an instance of a wxDbTable object. Each instance of this class describes one column in the wxDbTable -object. When calling the \helpref{wxDb constructor}{wxdbconstr}, a +object. When calling the \helpref{wxDb constructor}{wxdbctor}, a parameter passed in indicates the number of columns that will be defined for the wxDbTable object. The constructor uses this information to allocate adequate memory for all of the column descriptions in your wxDbTable object. @@ -1580,7 +1602,7 @@ public. \wxheading{See also} \helpref{database classes overview}{odbcoverview}, -\helpref{wxDbTable::GetColDefs}{wxdbtablegetcoldefs}, \helpref{wxDb constructor}{wxdbconstr} +\helpref{wxDbTable::GetColDefs}{wxdbtablegetcoldefs}, \helpref{wxDb constructor}{wxdbctor} \membersection{wxDbColDef::Initialize}\label{wxdbcoldefinitialize} @@ -1689,7 +1711,7 @@ name, user ID, password and default directory path (used with dBase). Other optional fields held in this class are and file type, both for future functions planned to be added for creating/manipulating datasource definitions. -\membersection{wxDbConnectInf::wxDbConnectInf} +\membersection{wxDbConnectInf::wxDbConnectInf}\label{wxdbconnectinfctor} \func{}{wxDbConnectInf}{\void} @@ -1708,15 +1730,15 @@ one in to the function. \wxheading{Parameters} -\docparam{henv}{Environment handle used for this connection. See +\docparam{henv}{Environment handle used for this connection. See\rtfsp \helpref{wxDConnectInf::AllocHenv}{wxdbconnectinfallochenv} for how to create an SQL environment handle. NOTE: Passing in a NULL for this parameter will inform the constructor that it should create its own SQL environment handle. -If NULL is passed for this parameter, the constructor will call +If NULL is passed for this parameter, the constructor will call\rtfsp \helpref{wxDConnectInf::AllocHenv}{wxdbconnectinfallochenv} internally. A flag is set internally also to indicate that the HENV was created by the constructor so that when the default class destructor is called, the -destructor will call \helpref{wxDConnectInf::FreeHenv}{wxdbconnectinffreehenv} +destructor will call \helpref{wxDConnectInf::FreeHenv}{wxdbconnectinffreehenv}\rtfsp to free the environment handle automatically.} \docparam{dsn}{Name of the datasource to be used in creating wxDb instances for creating connection(s) to a datasource.} @@ -1760,7 +1782,7 @@ automatically, and manage the destruction of the handle. Handles the default destruction of the instance of the class. If the long form of the \helpref{wxDConnectInf}{wxdbconnectinf} was used, then this destructor -also takes care of calling +also takes care of calling\rtfsp \helpref{wxDConnectInf::FreeHenv}{wxdbconnectinffreehenv} to free the SQL environment handle. @@ -1784,10 +1806,10 @@ Frees the SQL environment handle being managed by the instance of this class. \wxheading{Remarks} -If the SQL environment handle was created using the long form of the +If the SQL environment handle was created using the long form of the\rtfsp \helpref{wxDbConnectInf}{wxdbconnectinf} constructor, then the flag indicating that the HENV should be destroyed when the classes destructor is called -is reset to be false, so that any future handles created using the +is reset to be false, so that any future handles created using the\rtfsp \helpref{wxDbConnectInf::AllocHenv}{wxdbconnectinfallochenv} function must be manually released with a call to this function. @@ -1963,7 +1985,7 @@ class so a program can create a wxDbTableInf array instance to maintain all information about all tables in the datasource to have all the datasource's information in one memory structure. -Primarily, this class is used internally by the wxWindows ODBC classes. +Primarily, this class is used internally by the wxWidgets ODBC classes. \begin{verbatim} wxChar catalog[128+1]; @@ -3054,7 +3076,7 @@ calls which defined the columns accessible to this wxDbTable instance.} \wxheading{Remarks} -NULL column support is currently not fully implemented as of wxWindows 2.4. +NULL column support is currently not fully implemented as of wxWidgets 2.4. \membersection{wxDbTable::IsCursorClosedOnCommit}\label{wxdbtableiscursorclosedoncommit} @@ -3095,6 +3117,13 @@ cursors, (insert/select and update if connection is not wxDB\_QUERY\_ONLY) and constructs the insert statement that is to be used for inserting data as a new row in the datasource. +NOTE: To retrieve data into an opened table, the of the table must be bound +to the variables in the program via call(s) to +\helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs} before calling Open(). + +See the \helpref{database classes overview}{odbcoverview} for +an introduction to using the ODBC classes. + \wxheading{Parameters} \docparam{checkPrivileges}{Indicates whether the Open() function should check @@ -3128,6 +3157,7 @@ function can significantly speed up the privileges checks. \helpref{wxDb::TableExists}{wxdbtableexists}, \helpref{wxDb::TablePrivileges}{wxdbtableprivileges} +\helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs} \membersection{wxDbTable::OrderBy}\label{wxdbtableorderby} @@ -3275,7 +3305,7 @@ wxDbTable constructor, it is specified how many columns are in the wxDbTable object. The SELECT statement must return exactly that many columns. \item The columns must be returned in the same sequence as specified -when defining the bounds columns using wxDbTable::SetColDefs(), +when defining the bounds columns \helpref{wxDbTable::SetColDefs}{wxdbtablesetcoldefs}, and the columns returned must be of the proper data type. For example, if column 3 is defined in the wxDbTable bound column definitions to be a float, the SELECT statement must return a @@ -3966,7 +3996,7 @@ construction, NULL terminates the list. Use Null also if using two step constru See the database grid example in \helpref{wxDbGridTableBase}{wxdbgridtablebase} to see two different ways for adding columns. -\membersection{wxDbGridColInfo::\destruct{wxDbGridColInfo}} +\membersection{wxDbGridColInfo::\destruct{wxDbGridColInfo}}\label{wxdbgridcolinfodtor} \func{}{\destruct{wxDbGridColInfo}}{}