~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qsqlerror.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/sql/kernel/qsqlerror.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QSqlError Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QSqlError Class Reference</h1>
 
21
<p>The QSqlError class provides SQL database error information. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QSqlError&gt;</pre><p>Part of the <a href="qtsql.html">QtSql</a> module.</p>
 
23
<ul>
 
24
<li><a href="qsqlerror-members.html">List of all members, including inherited members</a></li>
 
25
</ul>
 
26
<a name="public-types"></a>
 
27
<h3>Public Types</h3>
 
28
<ul>
 
29
<li><div class="fn"/>enum <b><a href="qsqlerror.html#ErrorType-enum">ErrorType</a></b> { NoError, ConnectionError, StatementError, TransactionError, UnknownError }</li>
 
30
</ul>
 
31
<a name="public-functions"></a>
 
32
<h3>Public Functions</h3>
 
33
<ul>
 
34
<li><div class="fn"/><b><a href="qsqlerror.html#QSqlError">QSqlError</a></b> ( const QString &amp; <i>driverText</i> = QString(), const QString &amp; <i>databaseText</i> = QString(), ErrorType <i>type</i> = NoError, int <i>number</i> = -1 )</li>
 
35
<li><div class="fn"/><b><a href="qsqlerror.html#QSqlError-2">QSqlError</a></b> ( const QSqlError &amp; <i>other</i> )</li>
 
36
<li><div class="fn"/><b><a href="qsqlerror.html#dtor.QSqlError">~QSqlError</a></b> ()</li>
 
37
<li><div class="fn"/>QString <b><a href="qsqlerror.html#databaseText">databaseText</a></b> () const</li>
 
38
<li><div class="fn"/>QString <b><a href="qsqlerror.html#driverText">driverText</a></b> () const</li>
 
39
<li><div class="fn"/>int <b><a href="qsqlerror.html#number">number</a></b> () const</li>
 
40
<li><div class="fn"/>void <b><a href="qsqlerror.html#setDatabaseText">setDatabaseText</a></b> ( const QString &amp; <i>databaseText</i> )</li>
 
41
<li><div class="fn"/>void <b><a href="qsqlerror.html#setDriverText">setDriverText</a></b> ( const QString &amp; <i>driverText</i> )</li>
 
42
<li><div class="fn"/>void <b><a href="qsqlerror.html#setNumber">setNumber</a></b> ( int <i>number</i> )</li>
 
43
<li><div class="fn"/>void <b><a href="qsqlerror.html#setType">setType</a></b> ( ErrorType <i>type</i> )</li>
 
44
<li><div class="fn"/>QString <b><a href="qsqlerror.html#text">text</a></b> () const</li>
 
45
<li><div class="fn"/>ErrorType <b><a href="qsqlerror.html#type">type</a></b> () const</li>
 
46
<li><div class="fn"/>QSqlError &amp; <b><a href="qsqlerror.html#operator-eq">operator=</a></b> ( const QSqlError &amp; <i>other</i> )</li>
 
47
</ul>
 
48
<a name="details"></a>
 
49
<hr />
 
50
<h2>Detailed Description</h2>
 
51
<p>The QSqlError class provides SQL database error information.</p>
 
52
<p>A QSqlError object can provide database-specific error data, including the <a href="qsqlerror.html#driverText">driverText</a>() and <a href="qsqlerror.html#databaseText">databaseText</a>() messages (or both concatenated together as <a href="qsqlerror.html#text">text</a>()), and the error <a href="qsqlerror.html#number">number</a>() and <a href="qsqlerror.html#type">type</a>(). The functions all have setters so that you can create and return QSqlError objects from your own classes, for example from your own SQL drivers.</p>
 
53
<p>See also <a href="qsqldatabase.html#lastError">QSqlDatabase::lastError</a>() and <a href="qsqlquery.html#lastError">QSqlQuery::lastError</a>().</p>
 
54
<hr />
 
55
<h2>Member Type Documentation</h2>
 
56
<h3 class="fn"><a name="ErrorType-enum"></a>enum QSqlError::ErrorType</h3>
 
57
<p>This enum type describes the type of SQL error that occurred.</p>
 
58
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
59
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
60
<tr><td valign="top"><tt>QSqlError::NoError</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">No error occurred.</td></tr>
 
61
<tr><td valign="top"><tt>QSqlError::ConnectionError</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Connection error.</td></tr>
 
62
<tr><td valign="top"><tt>QSqlError::StatementError</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">SQL statement syntax error.</td></tr>
 
63
<tr><td valign="top"><tt>QSqlError::TransactionError</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Transaction failed error.</td></tr>
 
64
<tr><td valign="top"><tt>QSqlError::UnknownError</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">Unknown error.</td></tr>
 
65
</table>
 
66
<hr />
 
67
<h2>Member Function Documentation</h2>
 
68
<h3 class="fn"><a name="QSqlError"></a>QSqlError::QSqlError ( const <a href="qstring.html">QString</a> &amp; <i>driverText</i> = QString(), const <a href="qstring.html">QString</a> &amp; <i>databaseText</i> = QString(), <a href="qsqlerror.html#ErrorType-enum">ErrorType</a> <i>type</i> = NoError, int <i>number</i> = -1 )</h3>
 
69
<p>Constructs an error containing the driver error text <i>driverText</i>, the database-specific error text <i>databaseText</i>, the type <i>type</i> and the optional error number <i>number</i>.</p>
 
70
<h3 class="fn"><a name="QSqlError-2"></a>QSqlError::QSqlError ( const QSqlError &amp; <i>other</i> )</h3>
 
71
<p>Creates a copy of <i>other</i>.</p>
 
72
<h3 class="fn"><a name="dtor.QSqlError"></a>QSqlError::~QSqlError ()</h3>
 
73
<p>Destroys the object and frees any allocated resources.</p>
 
74
<h3 class="fn"><a name="databaseText"></a><a href="qstring.html">QString</a> QSqlError::databaseText () const</h3>
 
75
<p>Returns the text of the error as reported by the database. This may contain database-specific descriptions; it may be empty.</p>
 
76
<p>See also <a href="qsqlerror.html#setDatabaseText">setDatabaseText</a>(), <a href="qsqlerror.html#driverText">driverText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
 
77
<h3 class="fn"><a name="driverText"></a><a href="qstring.html">QString</a> QSqlError::driverText () const</h3>
 
78
<p>Returns the text of the error as reported by the driver. This may contain database-specific descriptions. It may also be empty.</p>
 
79
<p>See also <a href="qsqlerror.html#setDriverText">setDriverText</a>(), <a href="qsqlerror.html#databaseText">databaseText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
 
80
<h3 class="fn"><a name="number"></a>int QSqlError::number () const</h3>
 
81
<p>Returns the database-specific error number, or -1 if it cannot be determined.</p>
 
82
<p>See also <a href="qsqlerror.html#setNumber">setNumber</a>().</p>
 
83
<h3 class="fn"><a name="setDatabaseText"></a>void QSqlError::setDatabaseText ( const <a href="qstring.html">QString</a> &amp; <i>databaseText</i> )</h3>
 
84
<p>Sets the database error text to the value of <i>databaseText</i>.</p>
 
85
<p>See also <a href="qsqlerror.html#databaseText">databaseText</a>(), <a href="qsqlerror.html#setDriverText">setDriverText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
 
86
<h3 class="fn"><a name="setDriverText"></a>void QSqlError::setDriverText ( const <a href="qstring.html">QString</a> &amp; <i>driverText</i> )</h3>
 
87
<p>Sets the driver error text to the value of <i>driverText</i>.</p>
 
88
<p>See also <a href="qsqlerror.html#driverText">driverText</a>(), <a href="qsqlerror.html#setDatabaseText">setDatabaseText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
 
89
<h3 class="fn"><a name="setNumber"></a>void QSqlError::setNumber ( int <i>number</i> )</h3>
 
90
<p>Sets the database-specific error number to <i>number</i>.</p>
 
91
<p>See also <a href="qsqlerror.html#number">number</a>().</p>
 
92
<h3 class="fn"><a name="setType"></a>void QSqlError::setType ( <a href="qsqlerror.html#ErrorType-enum">ErrorType</a> <i>type</i> )</h3>
 
93
<p>Sets the error type to the value of <i>type</i>.</p>
 
94
<p>See also <a href="qsqlerror.html#type">type</a>().</p>
 
95
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> QSqlError::text () const</h3>
 
96
<p>This is a convenience function that returns <a href="qsqlerror.html#databaseText">databaseText</a>() and <a href="qsqlerror.html#driverText">driverText</a>() concatenated into a single string.</p>
 
97
<p>See also <a href="qsqlerror.html#driverText">driverText</a>() and <a href="qsqlerror.html#databaseText">databaseText</a>().</p>
 
98
<h3 class="fn"><a name="type"></a><a href="qsqlerror.html#ErrorType-enum">ErrorType</a> QSqlError::type () const</h3>
 
99
<p>Returns the error type, or -1 if the type cannot be determined.</p>
 
100
<p>See also <a href="qsqlerror.html#setType">setType</a>().</p>
 
101
<h3 class="fn"><a name="operator-eq"></a>QSqlError &amp; QSqlError::operator= ( const QSqlError &amp; <i>other</i> )</h3>
 
102
<p>Assigns the <i>other</i> error's values to this error.</p>
 
103
<p /><address><hr /><div align="center">
 
104
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
105
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
106
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
107
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
108
</tr></table></div></address></body>
 
109
</html>