]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/database.tex
*** empty log message ***
[wxWidgets.git] / docs / latex / wx / database.tex
CommitLineData
a660d684
KB
1\section{\class{wxDatabase}}\label{wxdatabase}
2
954b8ae6
JS
3Every database object represents an ODBC connection.
4The connection may be closed and reopened.
a660d684 5
954b8ae6 6\wxheading{Derived from}
a660d684
KB
7
8\helpref{wxObject}{wxobject}
9
954b8ae6
JS
10\wxheading{Include files}
11
12<wx/odbc.h>
13
a660d684
KB
14\wxheading{See also}
15
16\overview{wxDatabase overview}{wxdatabaseoverview}, \helpref{wxRecordSet}{wxrecordset}
17
18\latexignore{\rtfignore{\wxheading{Members}}}
19
20\membersection{wxDatabase::wxDatabase}
21
22\func{}{wxDatabase}{\void}
23
24Constructor. The constructor of the first wxDatabase instance of an
25application initializes the ODBC manager.
26
27\membersection{wxDatabase::\destruct{wxDatabase}}
28
29\func{}{\destruct{wxDatabase}}{\void}
30
31Destructor. Resets and destroys any associated wxRecordSet instances.
32
33The destructor of the last wxDatabase instance will deinitialize
34the ODBC manager.
35
36\membersection{wxDatabase::BeginTrans}
37
38\func{bool}{BeginTrans}{\void}
39
40Not implemented.
41
42\membersection{wxDatabase::Cancel}
43
44\func{void}{Cancel}{\void}
45
46Not implemented.
47
48\membersection{wxDatabase::CanTransact}
49
50\func{bool}{CanTransact}{\void}
51
52Not implemented.
53
54
55\membersection{wxDatabase::CanUpdate}
56
57\func{bool}{CanUpdate}{\void}
58
59Not implemented.
60
61\membersection{wxDatabase::Close}
62
63\func{bool}{Close}{\void}
64
65Resets the statement handles of any associated wxRecordSet objects,
66and disconnects from the current data source.
67
68\membersection{wxDatabase::CommitTrans}
69
70\func{bool}{CommitTrans}{\void}
71
72Commits previous transactions. Not implemented.
73
74\membersection{wxDatabase::ErrorOccured}
75
76\func{bool}{ErrorOccured}{\void}
77
78Returns TRUE if the last action caused an error.
79
80\membersection{wxDatabase::ErrorSnapshot}
81
82\func{void}{ErrorSnapshot}{\param{HSTMT}{ statement = SQL\_NULL\_HSTMT}}
83
84This function will be called whenever an ODBC error occured. It stores the
85error related information returned by ODBC. If a statement handle of the
86concerning ODBC action is available it should be passed to the function.
87
88\membersection{wxDatabase::GetDatabaseName}
89
90\func{wxString}{GetDatabaseName}{\void}
91
92Returns the name of the database associated with the current connection.
93
94\membersection{wxDatabase::GetDataSource}
95
96\func{wxString}{GetDataSource}{\void}
97
98Returns the name of the connected data source.
b8de493f 99
a660d684
KB
100\membersection{wxDatabase::GetErrorClass}
101
102\func{wxString}{GetErrorClass}{\void}
103
104Returns the error class of the last error. The error class consists of
105five characters where the first two characters contain the class
106and the other three characters contain the subclass of the ODBC error.
107See ODBC documentation for further details.
108
109\membersection{wxDatabase::GetErrorCode}
110
111\func{wxRETCODE}{GetErrorCode}{\void}
112
113Returns the error code of the last ODBC function call. This will be one of:
114
115\begin{twocollist}\itemsep=0pt
116\twocolitem{SQL\_ERROR}{General error.}
117\twocolitem{SQL\_INVALID\_HANDLE}{An invalid handle was passed to an ODBC function.}
118\twocolitem{SQL\_NEED\_DATA}{ODBC expected some data.}
119\twocolitem{SQL\_NO\_DATA\_FOUND}{No data was found by this ODBC call.}
120\twocolitem{SQL\_SUCCESS}{The call was successful.}
121\twocolitem{SQL\_SUCCESS\_WITH\_INFO}{The call was successful, but further information can be
122obtained from the ODBC manager.}
123\end{twocollist}
124
125\membersection{wxDatabase::GetErrorMessage}
126
127\func{wxString}{GetErrorMessage}{\void}
128
129Returns the last error message returned by the ODBC manager.
130
131\membersection{wxDatabase::GetErrorNumber}
132
133\func{long}{GetErrorNumber}{\void}
134
135Returns the last native error. A native error is an ODBC driver dependent
136error number.
137
138\membersection{wxDatabase::GetHDBC}
139
140\func{HDBC}{GetHDBC}{\void}
141
142Returns the current ODBC database handle.
143
144\membersection{wxDatabase::GetHENV}
145
146\func{HENV}{GetHENV}{\void}
147
148Returns the ODBC environment handle.
b8de493f 149
a660d684
KB
150\membersection{wxDatabase::GetInfo}
151
152\func{bool}{GetInfo}{\param{long}{ infoType}, \param{long *}{buf}}
153
154\func{bool}{GetInfo}{\param{long}{ infoType}, \param{const wxString\& }{buf}, \param{int}{ bufSize=-1}}
155
156Returns requested information. The return value is TRUE if successful, FALSE otherwise.
157
158{\it infoType} is an ODBC identifier specifying the type of information to be returned.
159
160{\it buf} is a character or long integer pointer to storage which must be allocated by the
161application, and which will contain the information if the function is successful.
162
163{\it bufSize} is the size of the character buffer. A value of -1 indicates that the size
164should be computed by the GetInfo function.
165
166\membersection{wxDatabase::GetPassword}
167
168\func{wxString}{GetPassword}{\void}
169
170Returns the password of the current user.
171
172\membersection{wxDatabase::GetUsername}
173
174\func{wxString}{GetUsername}{\void}
175
176Returns the current username.
177
178\membersection{wxDatabase::GetODBCVersionFloat}
179
180\func{float}{GetODBCVersionFloat}{\param{bool}{ implementation=TRUE}}
181
182Returns the version of ODBC in floating point format, e.g. 2.50.
183
184{\it implementation} should be TRUE to get the DLL version, or FALSE to get the
185version defined in the {\tt sql.h} header file.
186
187This function can return the value 0.0 if the header version number is not defined (for early
188versions of ODBC).
189
190\membersection{wxDatabase::GetODBCVersionString}
191
192\func{wxString}{GetODBCVersionString}{\param{bool}{ implementation=TRUE}}
193
194Returns the version of ODBC in string format, e.g. ``02.50".
195
196{\it implementation} should be TRUE to get the DLL version, or FALSE to get the
197version defined in the {\tt sql.h} header file.
198
199This function can return the value ``00.00" if the header version number is not defined (for early
200versions of ODBC).
201
202\membersection{wxDatabase::InWaitForDataSource}
203
204\func{bool}{InWaitForDataSource}{\void}
205
206Not implemented.
207
208\membersection{wxDatabase::IsOpen}
209
210\func{bool}{IsOpen}{\void}
211
212Returns TRUE if a connection is open.
213
214\membersection{wxDatabase::Open}\label{wxdatabaseopen}
215
216\func{bool}{Open}{\param{const wxString\& }{datasource}, \param{bool}{ exclusive = FALSE}, \param{bool }{readOnly = TRUE},
217 \param{const wxString\& }{username = ``ODBC"}, \param{const wxString\& }{password = ``"}}
218
219Connect to a data source. {\it datasource} contains the name of the ODBC data
220source. The parameters exclusive and readOnly are not used.
221
222\membersection{wxDatabase::OnSetOptions}
223
224\func{void}{OnSetOptions}{\param{wxRecordSet *}{recordSet}}
225
226Not implemented.
b8de493f 227
a660d684
KB
228\membersection{wxDatabase::OnWaitForDataSource}
229
230\func{void}{OnWaitForDataSource}{\param{bool}{ stillExecuting}}
231
232Not implemented.
233
234\membersection{wxDatabase::RollbackTrans}
235
236\func{bool}{RollbackTrans}{\void}
237
238Sends a rollback to the ODBC driver. Not implemented.
239
240\membersection{wxDatabase::SetDataSource}
241
242\func{void}{SetDataSource}{\param{const wxString\& }{s}}
243
244Sets the name of the data source. Not implemented.
b8de493f 245
a660d684
KB
246\membersection{wxDatabase::SetLoginTimeout}
247
248\func{void}{SetLoginTimeout}{\param{long}{ seconds}}
249
250Sets the time to wait for an user login. Not implemented.
b8de493f 251
a660d684
KB
252\membersection{wxDatabase::SetPassword}
253
254\func{void}{SetPassword}{\param{const wxString\& }{s}}
255
256Sets the password of the current user. Not implemented.
257
258\membersection{wxDatabase::SetSynchronousMode}
259
260\func{void}{SetSynchronousMode}{\param{bool }{synchronous}}
261
262Toggles between synchronous and asynchronous mode. Currently only synchronous
263mode is supported, so this function has no effect.
264
265\membersection{wxDatabase::SetQueryTimeout}
266
267\func{void}{SetQueryTimeout}{\param{long}{ seconds}}
268
269Sets the time to wait for a response to a query. Not implemented.
b8de493f 270
a660d684
KB
271\membersection{wxDatabase::SetUsername}
272
273\func{void}{SetUsername}{\param{const wxString\& }{s}}
274
275Sets the name of the current user. Not implemented.
276
277