1QSqlError(3qt) QSqlError(3qt)
2
3
4
6 QSqlError - SQL database error information
7
9 #include <qsqlerror.h>
10
11 Public Members
12 enum Type { None, Connection, Statement, Transaction, Unknown }
13 QSqlError ( const QString & driverText = QString::null, const QString &
14 databaseText = QString::null, int type = QSqlError::None, int
15 number = -1 )
16 QSqlError ( const QSqlError & other )
17 QSqlError & operator= ( const QSqlError & other )
18 virtual ~QSqlError ()
19 QString driverText () const
20 virtual void setDriverText ( const QString & driverText )
21 QString databaseText () const
22 virtual void setDatabaseText ( const QString & databaseText )
23 int type () const
24 virtual void setType ( int type )
25 int number () const
26 virtual void setNumber ( int number )
27 QString text () const
28 void showMessage ( const QString & msg = QString::null ) const
29 (obsolete)
30
32 The QSqlError class provides SQL database error information.
33
34 This class is used to report database-specific errors. An error
35 description and (if appropriate) a database-specific error number can
36 be obtained using this class.
37
38 See also Database Classes.
39
40 Member Type Documentation
42 This enum type describes the type of SQL error that occurred.
43
44 QSqlError::None - no error occurred
45
46 QSqlError::Connection - connection error
47
48 QSqlError::Statement - SQL statement syntax error
49
50 QSqlError::Transaction - transaction failed error
51
52 QSqlError::Unknown - unknown error
53
56 QString & databaseText = QString::null, int type = QSqlError::None, int
57 number = -1 )
58 Constructs an error containing the driver error text driverText, the
59 database-specific error text databaseText, the type type and the
60 optional error number number.
61
63 Creates a copy of other.
64
66 Destroys the object and frees any allocated resources.
67
69 Returns the text of the error as reported by the database. This may
70 contain database-specific descriptions.
71
73 Returns the text of the error as reported by the driver. This may
74 contain database-specific descriptions.
75
77 Returns the database-specific error number, or -1 if it cannot be
78 determined.
79
81 Sets the error equal to other.
82
84 Sets the database error text to the value of databaseText.
85
87 Sets the driver error text to the value of driverText.
88
90 Sets the database-specific error number to number.
91
93 Sets the error type to the value of type.
94
96 This function is obsolete. It is provided to keep old source working.
97 We strongly advise against using it in new code.
98
99 This is a convenience function that pops up a QMessageBox containing
100 the message returned by text(). An additional string can be passed in
101 via the msg parameter, which will be concatenated with the text()
102 message.
103
104 See also text(), driverText(), and databaseText().
105
107 This is a convenience function that returns databaseText() and
108 driverText() concatenated into a single string.
109
110 See also showMessage(), driverText(), and databaseText().
111
113 Returns the error type, or -1 if the type cannot be determined.
114
115 See also QSqlError::Type.
116
117
119 http://doc.trolltech.com/qsqlerror.html
120 http://www.trolltech.com/faq/tech.html
121
123 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
124 license file included in the distribution for a complete license
125 statement.
126
128 Generated automatically from the source code.
129
131 If you find a bug in Qt, please report it as described in
132 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
133 help you. Thank you.
134
135 The definitive Qt documentation is provided in HTML format; it is
136 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
137 web browser. This man page is provided as a convenience for those users
138 who prefer man pages, although this format is not officially supported
139 by Trolltech.
140
141 If you find errors in this manual page, please report them to qt-
142 bugs@trolltech.com. Please include the name of the manual page
143 (qsqlerror.3qt) and the Qt version (3.3.8).
144
145
146
147Trolltech AS 2 February 2007 QSqlError(3qt)