[190] | 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"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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 <<a href="qsqlerror-h.html">qsqlerror.h</a>></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 QString & driverText = QString::null, const QString & databaseText = QString::null, int type = QSqlError::None, int number = -1 )</li>
|
---|
| 42 | <li class=fn><a href="#QSqlError-2"><b>QSqlError</b></a> ( const QSqlError & other )</li>
|
---|
| 43 | <li class=fn>QSqlError & <a href="#operator-eq"><b>operator=</b></a> ( const QSqlError & 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 QString & 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 QString & 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 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 number )</li>
|
---|
| 53 | <li class=fn>QString <a href="#text"><b>text</b></a> () const</li>
|
---|
| 54 | <li class=fn>void showMessage ( const QString & msg = QString::null ) const <em>(obsolete)</em></li>
|
---|
| 55 | </ul>
|
---|
| 56 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | The QSqlError class provides SQL database error information.
|
---|
| 60 | <p>
|
---|
| 61 |
|
---|
| 62 | <p> This class is used to report database-specific errors. An error
|
---|
| 63 | description and (if appropriate) a database-specific error number
|
---|
| 64 | can 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 <a href="qstring.html">QString</a> & driverText = QString::null, const <a href="qstring.html">QString</a> & databaseText = QString::null, int type = QSqlError::None, int number = -1 )
|
---|
| 80 | </h3>
|
---|
| 81 | Constructs an error containing the driver error text <em>driverText</em>, the database-specific error text <em>databaseText</em>, the
|
---|
| 82 | type <em>type</em> and the optional error number <em>number</em>.
|
---|
| 83 |
|
---|
| 84 | <h3 class=fn><a name="QSqlError-2"></a>QSqlError::QSqlError ( const <a href="qsqlerror.html">QSqlError</a> & other )
|
---|
| 85 | </h3>
|
---|
| 86 | Creates a copy of <em>other</em>.
|
---|
| 87 |
|
---|
| 88 | <h3 class=fn><a name="~QSqlError"></a>QSqlError::~QSqlError ()<tt> [virtual]</tt>
|
---|
| 89 | </h3>
|
---|
| 90 | Destroys 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>
|
---|
| 94 | Returns the text of the error as reported by the database. This
|
---|
| 95 | may contain database-specific descriptions.
|
---|
| 96 |
|
---|
| 97 | <h3 class=fn><a href="qstring.html">QString</a> <a name="driverText"></a>QSqlError::driverText () const
|
---|
| 98 | </h3>
|
---|
| 99 | Returns the text of the error as reported by the driver. This may
|
---|
| 100 | contain database-specific descriptions.
|
---|
| 101 |
|
---|
| 102 | <h3 class=fn>int <a name="number"></a>QSqlError::number () const
|
---|
| 103 | </h3>
|
---|
| 104 | Returns the database-specific error number, or -1 if it cannot be
|
---|
| 105 | determined.
|
---|
| 106 |
|
---|
| 107 | <h3 class=fn><a href="qsqlerror.html">QSqlError</a> & <a name="operator-eq"></a>QSqlError::operator= ( const <a href="qsqlerror.html">QSqlError</a> & other )
|
---|
| 108 | </h3>
|
---|
| 109 | Sets the error equal to <em>other</em>.
|
---|
| 110 |
|
---|
| 111 | <h3 class=fn>void <a name="setDatabaseText"></a>QSqlError::setDatabaseText ( const <a href="qstring.html">QString</a> & databaseText )<tt> [virtual]</tt>
|
---|
| 112 | </h3>
|
---|
| 113 | Sets the database error text to the value of <em>databaseText</em>.
|
---|
| 114 |
|
---|
| 115 | <h3 class=fn>void <a name="setDriverText"></a>QSqlError::setDriverText ( const <a href="qstring.html">QString</a> & driverText )<tt> [virtual]</tt>
|
---|
| 116 | </h3>
|
---|
| 117 | Sets the driver error text to the value of <em>driverText</em>.
|
---|
| 118 |
|
---|
| 119 | <h3 class=fn>void <a name="setNumber"></a>QSqlError::setNumber ( int number )<tt> [virtual]</tt>
|
---|
| 120 | </h3>
|
---|
| 121 | Sets the database-specific error number to <em>number</em>.
|
---|
| 122 |
|
---|
| 123 | <h3 class=fn>void <a name="setType"></a>QSqlError::setType ( int type )<tt> [virtual]</tt>
|
---|
| 124 | </h3>
|
---|
| 125 | Sets the error type to the value of <em>type</em>.
|
---|
| 126 |
|
---|
| 127 | <h3 class=fn>void <a name="showMessage"></a>QSqlError::showMessage ( const <a href="qstring.html">QString</a> & 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>
|
---|
| 131 | containing the message returned by <a href="#text">text</a>(). An additional string
|
---|
| 132 | can be passed in via the <em>msg</em> parameter, which will be
|
---|
| 133 | concatenated 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>
|
---|
| 138 | This 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>
|
---|
| 144 | Returns 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>
|
---|
| 149 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 150 | Copyright © 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 © 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>
|
---|