[Interest] QsqlTableModel

Graham Labdon Graham.Labdon at avalonsciences.com
Wed Feb 18 15:19:51 CET 2015


There are no other queries

-----Original Message-----
From: Jason H [mailto:jhihn at gmx.com] 
Sent: 18 February 2015 14:07
To: Graham Labdon
Cc: Interest at qt-project.org
Subject: Re: [Interest] QsqlTableModel


> From: "Graham Labdon" <Graham.Labdon at avalonsciences.com>
>
> Hi
> I am attempting to use QSqlTableModel to delete rows from an Sqlite database. -
> 
> 	model->select();
> 	bool b = model->removeRows(0,200);
> 	model->submitAll();
> 
> The return value is false, so I thought I would get the last error using
> 
> QSqlError e = model->lastError();
> 
> However, this error has a type of NoError and all the error strings are empty
> 
> Can someone tell me what I am doing wrong?


One thing to check is that no other queries are open. I continually ran into problems with SQLite when I had another open. It'll make a large .journal file, but when the program exits, everything in the journal is lost. You could be getting false because it is still pending. 

I'm not sure that is your problem, but that is one thing to check.


More information about the Interest mailing list