You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qt3/doc/html/qsqlerror.html

158 lines
8.1 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/sql/qsqlerror.cpp:42 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QSqlError Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<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>
<p>The QSqlError class provides SQL database error information.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qsqlerror-h.html">qsqlerror.h</a>&gt;</tt>
<p><a href="qsqlerror-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#Type-enum"><b>Type</b></a> { None, Connection, Statement, Transaction, Unknown }</li>
<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>
<li class=fn><a href="#QSqlError-2"><b>QSqlError</b></a> ( const&nbsp;QSqlError&nbsp;&amp;&nbsp;other )</li>
<li class=fn>QSqlError &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QSqlError&nbsp;&amp;&nbsp;other )</li>
<li class=fn>virtual <a href="#~QSqlError"><b>~QSqlError</b></a> ()</li>
<li class=fn>QString <a href="#driverText"><b>driverText</b></a> () const</li>
<li class=fn>virtual void <a href="#setDriverText"><b>setDriverText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;driverText )</li>
<li class=fn>QString <a href="#databaseText"><b>databaseText</b></a> () const</li>
<li class=fn>virtual void <a href="#setDatabaseText"><b>setDatabaseText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;databaseText )</li>
<li class=fn>int <a href="#type"><b>type</b></a> () const</li>
<li class=fn>virtual void <a href="#setType"><b>setType</b></a> ( int&nbsp;type )</li>
<li class=fn>int <a href="#number"><b>number</b></a> () const</li>
<li class=fn>virtual void <a href="#setNumber"><b>setNumber</b></a> ( int&nbsp;number )</li>
<li class=fn>QString <a href="#text"><b>text</b></a> () const</li>
<li class=fn>void showMessage ( const&nbsp;QString&nbsp;&amp;&nbsp;msg = QString::null ) const &nbsp;<em>(obsolete)</em></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The QSqlError class provides SQL database error information.
<p>
<p> This class is used to report database-specific errors. An error
description and (if appropriate) a database-specific error number
can be obtained using this class.
<p>See also <a href="database.html">Database Classes</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Type-enum"></a>QSqlError::Type</h3>
<p> This enum type describes the type of SQL error that occurred.
<ul>
<li><tt>QSqlError::None</tt> - no error occurred
<li><tt>QSqlError::Connection</tt> - connection error
<li><tt>QSqlError::Statement</tt> - SQL statement syntax error
<li><tt>QSqlError::Transaction</tt> - transaction failed error
<li><tt>QSqlError::Unknown</tt> - unknown error
</ul>
<hr><h2>Member Function Documentation</h2>
<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 )
</h3>
Constructs an error containing the driver error text <em>driverText</em>, the database-specific error text <em>databaseText</em>, the
type <em>type</em> and the optional error number <em>number</em>.
<h3 class=fn><a name="QSqlError-2"></a>QSqlError::QSqlError ( const&nbsp;<a href="qsqlerror.html">QSqlError</a>&nbsp;&amp;&nbsp;other )
</h3>
Creates a copy of <em>other</em>.
<h3 class=fn><a name="~QSqlError"></a>QSqlError::~QSqlError ()<tt> [virtual]</tt>
</h3>
Destroys the object and frees any allocated resources.
<h3 class=fn><a href="qstring.html">QString</a> <a name="databaseText"></a>QSqlError::databaseText () const
</h3>
Returns the text of the error as reported by the database. This
may contain database-specific descriptions.
<h3 class=fn><a href="qstring.html">QString</a> <a name="driverText"></a>QSqlError::driverText () const
</h3>
Returns the text of the error as reported by the driver. This may
contain database-specific descriptions.
<h3 class=fn>int <a name="number"></a>QSqlError::number () const
</h3>
Returns the database-specific error number, or -1 if it cannot be
determined.
<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 )
</h3>
Sets the error equal to <em>other</em>.
<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>
</h3>
Sets the database error text to the value of <em>databaseText</em>.
<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>
</h3>
Sets the driver error text to the value of <em>driverText</em>.
<h3 class=fn>void <a name="setNumber"></a>QSqlError::setNumber ( int&nbsp;number )<tt> [virtual]</tt>
</h3>
Sets the database-specific error number to <em>number</em>.
<h3 class=fn>void <a name="setType"></a>QSqlError::setType ( int&nbsp;type )<tt> [virtual]</tt>
</h3>
Sets the error type to the value of <em>type</em>.
<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
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> This is a convenience function that pops up a <a href="qmessagebox.html">QMessageBox</a>
containing the message returned by <a href="#text">text</a>(). An additional string
can be passed in via the <em>msg</em> parameter, which will be
concatenated with the text() message.
<p> <p>See also <a href="#text">text</a>(), <a href="#driverText">driverText</a>(), and <a href="#databaseText">databaseText</a>().
<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QSqlError::text () const
</h3>
This is a convenience function that returns <a href="#databaseText">databaseText</a>() and
<a href="#driverText">driverText</a>() concatenated into a single string.
<p> <p>See also <a href="#showMessage">showMessage</a>(), <a href="#driverText">driverText</a>(), and <a href="#databaseText">databaseText</a>().
<h3 class=fn>int <a name="type"></a>QSqlError::type () const
</h3>
Returns the error type, or -1 if the type cannot be determined.
<p> <p>See also <a href="#Type-enum">QSqlError::Type</a>.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>