Quote Originally Posted by jpn View Post
Perhaps you forgot to call Erpel::dbConnect()?
Hello jpn,

I prefer to call Erpel::dbConnect() when I need some datas from my database, not during starting the program.

Like this for example:

Qt Code:
  1. void Erpel::showKasseLayout()
  2. {
  3. if (dbConnect(currentMandant))
  4. {
  5. QSqlQuery query;
  6. QString image;
  7.  
  8. query.prepare("SELECT ID, Beschriftung, ArtikelNummer, Image, ToolTip, TimeStamp FROM kassenlayout");
  9.  
  10. query.exec();
  11.  
  12. if (query.isSelect())
  13. query.first();
  14.  
  15. // more code follows here ....
To copy to clipboard, switch view to plain text mode 

I think it's a little bit more code and a little bit more to do for the computer, but it's safer.

Is that correct?