Page 1 of 1

Type of QSqlError

PostPosted: Wed May 23, 2012 8:37 am
by andigor
How can I determine type of QSqlError which was returned from your library? Especially I need to know about errNoData() type.

Re: Type of QSqlError

PostPosted: Wed May 23, 2012 9:58 am
by QxOrm admin
Hi,

When QxOrm library detects an internal error using qx::dao functions, it returns a QSqlError instance with a type of QSqlError::UnknownError.
Maybe one thing I can add to the library is a number error : you would be able to get this code error using QSqlError::number() method.
With current version of QxOrm library, you can use the QSqlError::databaseText() method to know which error you have.
For example :
Code: Select all
if (myDaoError.databaseText() == "[QxOrm] sql query returns no data")
{
   // Here is a errNoData() error
}


Note : for more details about QSqlError class : http://doc.qt.nokia.com/4.7-snapshot/qsqlerror.html