QSqlError Class Reference
|
Constant | Value | Description |
---|---|---|
QSqlError::NoError | 0 | No error occurred. |
QSqlError::ConnectionError | 1 | Connection error. |
QSqlError::StatementError | 2 | SQL statement syntax error. |
QSqlError::TransactionError | 3 | Transaction failed error. |
QSqlError::UnknownError | 4 | Unknown error. |
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number.
Creates a copy of other.
Destroys the object and frees any allocated resources.
Returns the text of the error as reported by the database. This may contain database-specific descriptions; it may be empty.
See also setDatabaseText(), driverText(), and text().
Returns the text of the error as reported by the driver. This may contain database-specific descriptions. It may also be empty.
See also setDriverText(), databaseText(), and text().
Returns true if an error is set, otherwise false.
Example:
QSqlQueryModel model; model.setQuery("select * from myTable"); if (model.lastError().isValid()) qDebug() << model.lastError();
See also type().
Returns the database-specific error number, or -1 if it cannot be determined.
See also setNumber().
Sets the database error text to the value of databaseText.
See also databaseText(), setDriverText(), and text().
Sets the driver error text to the value of driverText.
See also driverText(), setDatabaseText(), and text().
Sets the database-specific error number to number.
See also number().
Sets the error type to the value of type.
See also type().
This is a convenience function that returns databaseText() and driverText() concatenated into a single string.
See also driverText() and databaseText().
Returns the error type, or -1 if the type cannot be determined.
See also setType().
Assigns the other error's values to this error.
Copyright © 2008 Nokia | Trademarks | Qt 4.4.3 |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |