Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, April 2008
Using Sqlite in Qt 3x


Message 1 in thread

Hi all,
I have been experimenting with the SQLITE drivers in Qt3 and Qt4. In Qt3 I 
have encountered a problem. Clearly it's using sqlite 2x. I have had trouble 
reading files but found it does create a file if it's not there. So far so 
good, this should work. I used all "text" data types for two tables to be 
simple and safe at first and created two tables and added a row to one. I can 
query tables fine and any "select * from table" works fine. However if I try 
to do "select info from category" I get a crash.

I'm using QSqlQuery without using prepare. Using Postgres or Mysql I can do 
any query and also run multiple queries with semicolons separating them. With 
sqlite I can't run multiple SQL strings to exec inserts or table creation 
either. I can't seem to find good examples and I'm puzzled about the sqlite 
behavior. Can anyone offer any insight?
-- 
 [ signature omitted ] 

Message 2 in thread

On Wednesday 16 April 2008 4:04:26 pm Eric Laffoon wrote:
> In Qt3 I
> have encountered a problem. Clearly it's using sqlite 2x.

Seriously, can someone tell me if I'm insane? I let the program create the 
database and insert the data to be sure there are no compatibility issues

//works
SELECT * FROM table

//crashes
SELECT field FROM table

I can't imagine this being a universal problem unless prior version of sqlite 
were just lamer than I could imagine, or maybe it's something with my build. 
I can find no reference examples to look at, and try to see if it's something 
I'm doing. NOTE - Postgres and Mysql work great with the same code.
-- 
 [ signature omitted ]