Type of QSqlError

Forum for posting problems using QxOrm library

Type of QSqlError

Postby andigor » Wed May 23, 2012 8:37 am

How can I determine type of QSqlError which was returned from your library? Especially I need to know about errNoData() type.
andigor
 
Posts: 14
Joined: Wed May 02, 2012 11:53 am

Re: Type of QSqlError

Postby QxOrm admin » Wed May 23, 2012 9:58 am

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
QxOrm admin
 


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 3 guests