Page 1 of 2

SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 1:25 am
by vilian
Hi Antônio,

I would like to develop an app that can work with these two databases. Do you know if is possible to use both with the same code? only changing the initial connection?
I'm not intended use both at the same time, but some users want or need SqlLite and other choose to use Mysql.

Is it possible ? how?

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 5:50 am
by Antonio Linares
Vilian,

Do you mean using FiveTouch or FWH ?

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 10:44 am
by vilian
Fivetouch.

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 10:46 am
by Antonio Linares
Vilian,

You have to use a Web service so you can manage any database engine :-)

viewtopic.php?f=33&t=31621&start=0

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 10:56 am
by vilian
Antônio,
Do I must to do the server of webservice?
I was thinking that SqlLite is the internal database of Android, isn't it ? How to do a webservice for it?

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 11:11 am
by Antonio Linares
QT provides support for SqlLite (FiveTouch uses QT):

https://katecpp.wordpress.com/2015/08/28/sqlite-with-qt/

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 11:29 am
by vilian
But Can I use the same way to use MySql ?

Re: SqlLite OR MySql

PostPosted: Wed Sep 19, 2018 1:06 pm
by Antonio Linares

Re: SqlLite OR MySql

PostPosted: Wed Oct 17, 2018 8:50 pm
by vilian
Antônio,

I believe it's that I want, but I don't how to use this code in Fivetouch ! I have tried by this way, but don't worked !
#include "FiveTouch.ch"

function Main()
LOCAL oBD

oDB := QSqlDatabase()
oDB:addDatabase("QMYSQL")
oDB:setHostName("10.10.1.1")
oDB:setDatabaseName("fox_sgv")
oDB:setUserName("root")
oDB:setPassword("Xxxx")
oDB:open()

RETURN NIL


But, when I try run the app, is shown a message of Undefined Function QSQLDATABASE. Could you help me ?

Re: SqlLite OR MySql

PostPosted: Fri Oct 19, 2018 4:23 pm
by cnavarro
Your code is correct, but

Para que este código compile bien, es necesario que se añada el módulo sql al proyecto, es decir al fichero *.pro con la linea:

QT+=sql


Re: SqlLite OR MySql

PostPosted: Fri Oct 19, 2018 6:53 pm
by vilian
In my directory of Fivetouch there are no files *.pro :(

Re: SqlLite OR MySql

PostPosted: Fri Oct 19, 2018 9:48 pm
by cnavarro
You do not have/use the project fivetouch.pro?

Re: SqlLite OR MySql

PostPosted: Fri Oct 19, 2018 10:06 pm
by vilian
No,
I'm using Fivetouch Version that Antônio has published here http://forums.fivetechsupport.com/viewtopic.php?f=32&t=35529

Re: SqlLite OR MySql

PostPosted: Sat Oct 20, 2018 1:10 am
by cnavarro
vilian wrote:No,
I'm using Fivetouch Version that Antônio has published here http://forums.fivetechsupport.com/viewtopic.php?f=32&t=35529


Folder Windows, not?

Re: SqlLite OR MySql

PostPosted: Sat Oct 20, 2018 2:24 pm
by vilian
This is evertyhing I have in Fivetouch directory:
Image