source: trunk/doc/html/qsqlerror.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/sql/qsqlerror.cpp:42 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QSqlError Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSqlError Class Reference<br><small>[<a href="sql.html">sql module</a>]</small></h1>
33
34<p>The QSqlError class provides SQL database error information.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qsqlerror-h.html">qsqlerror.h</a>&gt;</tt>
37<p><a href="qsqlerror-members.html">List of all member functions.</a>
38<h2>Public Members</h2>
39<ul>
40<li class=fn>enum <a href="#Type-enum"><b>Type</b></a> { None, Connection, Statement, Transaction, Unknown }</li>
41<li class=fn><a href="#QSqlError"><b>QSqlError</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;driverText = QString::null, const&nbsp;QString&nbsp;&amp;&nbsp;databaseText = QString::null, int&nbsp;type = QSqlError::None, int&nbsp;number = -1 )</li>
42<li class=fn><a href="#QSqlError-2"><b>QSqlError</b></a> ( const&nbsp;QSqlError&nbsp;&amp;&nbsp;other )</li>
43<li class=fn>QSqlError &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QSqlError&nbsp;&amp;&nbsp;other )</li>
44<li class=fn>virtual <a href="#~QSqlError"><b>~QSqlError</b></a> ()</li>
45<li class=fn>QString <a href="#driverText"><b>driverText</b></a> () const</li>
46<li class=fn>virtual void <a href="#setDriverText"><b>setDriverText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;driverText )</li>
47<li class=fn>QString <a href="#databaseText"><b>databaseText</b></a> () const</li>
48<li class=fn>virtual void <a href="#setDatabaseText"><b>setDatabaseText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;databaseText )</li>
49<li class=fn>int <a href="#type"><b>type</b></a> () const</li>
50<li class=fn>virtual void <a href="#setType"><b>setType</b></a> ( int&nbsp;type )</li>
51<li class=fn>int <a href="#number"><b>number</b></a> () const</li>
52<li class=fn>virtual void <a href="#setNumber"><b>setNumber</b></a> ( int&nbsp;number )</li>
53<li class=fn>QString <a href="#text"><b>text</b></a> () const</li>
54<li class=fn>void showMessage ( const&nbsp;QString&nbsp;&amp;&nbsp;msg = QString::null ) const &nbsp;<em>(obsolete)</em></li>
55</ul>
56<hr><a name="details"></a><h2>Detailed Description</h2>
57
58
59The QSqlError class provides SQL database error information.
60<p>
61
62<p> This class is used to report database-specific errors. An error
63description and (if appropriate) a database-specific error number
64can be obtained using this class.
65<p>See also <a href="database.html">Database Classes</a>.
66
67<hr><h2>Member Type Documentation</h2>
68<h3 class=fn><a name="Type-enum"></a>QSqlError::Type</h3>
69
70<p> This enum type describes the type of SQL error that occurred.
71<ul>
72<li><tt>QSqlError::None</tt> - no error occurred
73<li><tt>QSqlError::Connection</tt> - connection error
74<li><tt>QSqlError::Statement</tt> - SQL statement syntax error
75<li><tt>QSqlError::Transaction</tt> - transaction failed error
76<li><tt>QSqlError::Unknown</tt> - unknown error
77</ul>
78<hr><h2>Member Function Documentation</h2>
79<h3 class=fn><a name="QSqlError"></a>QSqlError::QSqlError ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;driverText = QString::null, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;databaseText = QString::null, int&nbsp;type = QSqlError::None, int&nbsp;number = -1 )
80</h3>
81Constructs an error containing the driver error text <em>driverText</em>, the database-specific error text <em>databaseText</em>, the
82type <em>type</em> and the optional error number <em>number</em>.
83
84<h3 class=fn><a name="QSqlError-2"></a>QSqlError::QSqlError ( const&nbsp;<a href="qsqlerror.html">QSqlError</a>&nbsp;&amp;&nbsp;other )
85</h3>
86Creates a copy of <em>other</em>.
87
88<h3 class=fn><a name="~QSqlError"></a>QSqlError::~QSqlError ()<tt> [virtual]</tt>
89</h3>
90Destroys the object and frees any allocated resources.
91
92<h3 class=fn><a href="qstring.html">QString</a> <a name="databaseText"></a>QSqlError::databaseText () const
93</h3>
94Returns the text of the error as reported by the database. This
95may contain database-specific descriptions.
96
97<h3 class=fn><a href="qstring.html">QString</a> <a name="driverText"></a>QSqlError::driverText () const
98</h3>
99Returns the text of the error as reported by the driver. This may
100contain database-specific descriptions.
101
102<h3 class=fn>int <a name="number"></a>QSqlError::number () const
103</h3>
104Returns the database-specific error number, or -1 if it cannot be
105determined.
106
107<h3 class=fn><a href="qsqlerror.html">QSqlError</a>&nbsp;&amp; <a name="operator-eq"></a>QSqlError::operator= ( const&nbsp;<a href="qsqlerror.html">QSqlError</a>&nbsp;&amp;&nbsp;other )
108</h3>
109Sets the error equal to <em>other</em>.
110
111<h3 class=fn>void <a name="setDatabaseText"></a>QSqlError::setDatabaseText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;databaseText )<tt> [virtual]</tt>
112</h3>
113Sets the database error text to the value of <em>databaseText</em>.
114
115<h3 class=fn>void <a name="setDriverText"></a>QSqlError::setDriverText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;driverText )<tt> [virtual]</tt>
116</h3>
117Sets the driver error text to the value of <em>driverText</em>.
118
119<h3 class=fn>void <a name="setNumber"></a>QSqlError::setNumber ( int&nbsp;number )<tt> [virtual]</tt>
120</h3>
121Sets the database-specific error number to <em>number</em>.
122
123<h3 class=fn>void <a name="setType"></a>QSqlError::setType ( int&nbsp;type )<tt> [virtual]</tt>
124</h3>
125Sets the error type to the value of <em>type</em>.
126
127<h3 class=fn>void <a name="showMessage"></a>QSqlError::showMessage ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;msg = QString::null ) const
128</h3>
129<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
130<p> This is a convenience function that pops up a <a href="qmessagebox.html">QMessageBox</a>
131containing the message returned by <a href="#text">text</a>(). An additional string
132can be passed in via the <em>msg</em> parameter, which will be
133concatenated with the text() message.
134<p> <p>See also <a href="#text">text</a>(), <a href="#driverText">driverText</a>(), and <a href="#databaseText">databaseText</a>().
135
136<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QSqlError::text () const
137</h3>
138This is a convenience function that returns <a href="#databaseText">databaseText</a>() and
139<a href="#driverText">driverText</a>() concatenated into a single string.
140<p> <p>See also <a href="#showMessage">showMessage</a>(), <a href="#driverText">driverText</a>(), and <a href="#databaseText">databaseText</a>().
141
142<h3 class=fn>int <a name="type"></a>QSqlError::type () const
143</h3>
144Returns the error type, or -1 if the type cannot be determined.
145<p> <p>See also <a href="#Type-enum">QSqlError::Type</a>.
146
147<!-- eof -->
148<hr><p>
149This file is part of the <a href="index.html">Qt toolkit</a>.
150Copyright &copy; 1995-2007
151<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
152<table width=100% cellspacing=0 border=0><tr>
153<td>Copyright &copy; 2007
154<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
155<td align=right><div align=right>Qt 3.3.8</div>
156</table></div></address></body>
157</html>
Note: See TracBrowser for help on using the repository browser.