Eneboo - Documentación para desarrolladores
|
The QSqlError class provides SQL database error information. Más...
#include <qsqlerror.h>
Tipos públicos | |
enum | Type { None, Connection, Statement, Transaction, Unknown, None, Connection, Statement, Transaction, Unknown } |
enum | Type { None, Connection, Statement, Transaction, Unknown, None, Connection, Statement, Transaction, Unknown } |
Métodos públicos | |
QSqlError (const QString &driverText=QString::null, const QString &databaseText=QString::null, int type=QSqlError::None, int number=-1) | |
QSqlError (const QSqlError &other) | |
QSqlError & | operator= (const QSqlError &other) |
virtual | ~QSqlError () |
QString | driverText () const |
virtual void | setDriverText (const QString &driverText) |
QString | databaseText () const |
virtual void | setDatabaseText (const QString &databaseText) |
int | type () const |
virtual void | setType (int type) |
int | number () const |
virtual void | setNumber (int number) |
QString | text () const |
void | showMessage (const QString &msg=QString::null) const |
QSqlError (const QString &driverText=QString::null, const QString &databaseText=QString::null, int type=QSqlError::None, int number=-1) | |
QSqlError (const QSqlError &other) | |
QSqlError & | operator= (const QSqlError &other) |
virtual | ~QSqlError () |
QString | driverText () const |
virtual void | setDriverText (const QString &driverText) |
QString | databaseText () const |
virtual void | setDatabaseText (const QString &databaseText) |
int | type () const |
virtual void | setType (int type) |
int | number () const |
virtual void | setNumber (int number) |
QString | text () const |
void | showMessage (const QString &msg=QString::null) const |
The QSqlError class provides SQL database error information.
sql
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.
enum QSqlError::Type |
This enum type describes the type of SQL error that occurred.
None no error occurred Connection connection error Statement SQL statement syntax error Transaction transaction failed error Unknown unknown error
enum QSqlError::Type |
QSqlError::QSqlError | ( | const QString & | driverText = QString::null , |
const QString & | databaseText = QString::null , |
||
int | type = QSqlError::None , |
||
int | number = -1 |
||
) |
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number.
QSqlError::QSqlError | ( | const QSqlError & | other | ) |
Creates a copy of other.
QSqlError::~QSqlError | ( | ) | [virtual] |
Destroys the object and frees any allocated resources.
QSqlError::QSqlError | ( | const QString & | driverText = QString::null , |
const QString & | databaseText = QString::null , |
||
int | type = QSqlError::None , |
||
int | number = -1 |
||
) |
QSqlError::QSqlError | ( | const QSqlError & | other | ) |
virtual QSqlError::~QSqlError | ( | ) | [virtual] |
QString QSqlError::databaseText | ( | ) | const |
Returns the text of the error as reported by the database. This may contain database-specific descriptions.
QString QSqlError::databaseText | ( | ) | const |
QString QSqlError::driverText | ( | ) | const |
Returns the text of the error as reported by the driver. This may contain database-specific descriptions.
QString QSqlError::driverText | ( | ) | const |
int QSqlError::number | ( | ) | const |
Returns the database-specific error number, or -1 if it cannot be determined.
int QSqlError::number | ( | ) | const |
virtual void QSqlError::setDatabaseText | ( | const QString & | databaseText | ) | [virtual] |
void QSqlError::setDatabaseText | ( | const QString & | databaseText | ) | [virtual] |
Sets the database error text to the value of databaseText.
void QSqlError::setDriverText | ( | const QString & | driverText | ) | [virtual] |
Sets the driver error text to the value of driverText.
virtual void QSqlError::setDriverText | ( | const QString & | driverText | ) | [virtual] |
void QSqlError::setNumber | ( | int | number | ) | [virtual] |
Sets the database-specific error number to number.
virtual void QSqlError::setNumber | ( | int | number | ) | [virtual] |
void QSqlError::setType | ( | int | type | ) | [virtual] |
Sets the error type to the value of type.
virtual void QSqlError::setType | ( | int | type | ) | [virtual] |
void QSqlError::showMessage | ( | const QString & | msg = QString::null | ) | const |
void QSqlError::showMessage | ( | const QString & | msg = QString::null | ) | const |
This is a convenience function that pops up a QMessageBox containing the message returned by text(). An additional string can be passed in via the msg parameter, which will be concatenated with the text() message.
QString QSqlError::text | ( | ) | const |
This is a convenience function that returns databaseText() and driverText() concatenated into a single string.
QString QSqlError::text | ( | ) | const |
int QSqlError::type | ( | ) | const |
int QSqlError::type | ( | ) | const |
Returns the error type, or -1 if the type cannot be determined.