summaryrefslogtreecommitdiffstats
path: root/doc/html/ntqsqlerror.html
blob: 37c25dfd58b935658f84adea12863a91b6e27962 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!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>TQSqlError 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>TQSqlError Class Reference<br><small>[<a href="sql.html">sql module</a>]</small></h1>

<p>The TQSqlError class provides SQL database error information.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qsqlerror-h.html">ntqsqlerror.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="#TQSqlError"><b>TQSqlError</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;driverText = TQString::null, const&nbsp;TQString&nbsp;&amp;&nbsp;databaseText = TQString::null, int&nbsp;type = TQSqlError::None, int&nbsp;number = -1 )</li>
<li class=fn><a href="#TQSqlError-2"><b>TQSqlError</b></a> ( const&nbsp;TQSqlError&nbsp;&amp;&nbsp;other )</li>
<li class=fn>TQSqlError &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;TQSqlError&nbsp;&amp;&nbsp;other )</li>
<li class=fn>virtual <a href="#~TQSqlError"><b>~TQSqlError</b></a> ()</li>
<li class=fn>TQString <a href="#driverText"><b>driverText</b></a> () const</li>
<li class=fn>virtual void <a href="#setDriverText"><b>setDriverText</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;driverText )</li>
<li class=fn>TQString <a href="#databaseText"><b>databaseText</b></a> () const</li>
<li class=fn>virtual void <a href="#setDatabaseText"><b>setDatabaseText</b></a> ( const&nbsp;TQString&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>TQString <a href="#text"><b>text</b></a> () const</li>
<li class=fn>void showMessage ( const&nbsp;TQString&nbsp;&amp;&nbsp;msg = TQString::null ) const &nbsp;<em>(obsolete)</em></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQSqlError 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>TQSqlError::Type</h3>

<p> This enum type describes the type of SQL error that occurred.
<ul>
<li><tt>TQSqlError::None</tt> - no error occurred
<li><tt>TQSqlError::Connection</tt> - connection error
<li><tt>TQSqlError::Statement</tt> - SQL statement syntax error
<li><tt>TQSqlError::Transaction</tt> - transaction failed error
<li><tt>TQSqlError::Unknown</tt> - unknown error
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQSqlError"></a>TQSqlError::TQSqlError ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;driverText = TQString::null, const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;databaseText = TQString::null, int&nbsp;type = TQSqlError::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="TQSqlError-2"></a>TQSqlError::TQSqlError ( const&nbsp;<a href="ntqsqlerror.html">TQSqlError</a>&nbsp;&amp;&nbsp;other )
</h3>
Creates a copy of <em>other</em>.

<h3 class=fn><a name="~TQSqlError"></a>TQSqlError::~TQSqlError ()<tt> [virtual]</tt>
</h3>
Destroys the object and frees any allocated resources.

<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="databaseText"></a>TQSqlError::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="ntqstring.html">TQString</a> <a name="driverText"></a>TQSqlError::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>TQSqlError::number () const
</h3>
Returns the database-specific error number, or -1 if it cannot be
determined.

<h3 class=fn><a href="ntqsqlerror.html">TQSqlError</a>&nbsp;&amp; <a name="operator-eq"></a>TQSqlError::operator= ( const&nbsp;<a href="ntqsqlerror.html">TQSqlError</a>&nbsp;&amp;&nbsp;other )
</h3>
Sets the error equal to <em>other</em>.

<h3 class=fn>void <a name="setDatabaseText"></a>TQSqlError::setDatabaseText ( const&nbsp;<a href="ntqstring.html">TQString</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>TQSqlError::setDriverText ( const&nbsp;<a href="ntqstring.html">TQString</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>TQSqlError::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>TQSqlError::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>TQSqlError::showMessage ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;msg = TQString::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="ntqmessagebox.html">TQMessageBox</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="ntqstring.html">TQString</a> <a name="text"></a>TQSqlError::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>TQSqlError::type () const
</h3>
Returns the error type, or -1 if the type cannot be determined.
<p> <p>See also <a href="#Type-enum">TQSqlError::Type</a>.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt 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>TQt 3.3.8</div>
</table></div></address></body>
</html>