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

Qt-interest Archive, April 2008
sqlite driver works on Gnu/Linux but fails on Windows (same qt version)


Message 1 in thread

Hi,

I encountered this strange problem. Below is small select statement in 
sqlite on command line.

SQLite version 3.5.4
Enter ".help" for instructions
sqlite> SELECT SUBSTR("Example String One", 9);
String One
sqlite>

Now when I use this statement within a QT application on Linux ( I am 
using OpenSuse 10.3, Qt-4.3.4), there is no problem...  meaning that I 
get the same result as shown above.

BUT, when compiling and using the same QT application on Windows (On 
Windows also I am using Qt-4.3.4), I get  error from the sqlite, saying 
"Wrong number of arguments passed to function SUBSTR(). ......"

Why would that be? Could there be some driver issues with the stock 
sqlite driver that comes default with Qt on windows ?  On OpenSuse I 
upgraded to qt-4.3.4 by downloading the relevant rpm packages from 
opensuse. And on windows I downloaded the qt-win-opensource-4.3.4-mingw 
and using the default dynamic installation.

Alternatively I tried to recompile the driver with the new sqlite-3.5.7 
dll file following the instructions in the Qt docs. The driver compiled 
successfully (it did throw out some warnings at compile time) but still 
the same results. I mean I still get error in sqlite as described above.

I can't figure out the problem and rectify it. Any clues would be helpful.

Regards,
Rajen.


--
 [ signature omitted ] 

Message 2 in thread

In continuation to my previous mail, I added a query to my appliction as
below;

QSqlQuery query("Select sqlite_version()");

The above query returns 3.5.4 on my OpenSuse Linux system, and 3.3.17 on
windows-XP machine. Both of them use Qt-4.3.4 and the same application code
that I am trying to develop.

So, it seems that SUBSTR() function probably behaves differently in 3.3.17
and 3.5.4.

Can somebody guide as to how I could upgrade the sqlite library in Qt-4.3.4
on Windows-XP so that I could use sqlite-3.5.4 or maybe the latest 3.5.7.

TIA,
Rajen.