SqlLite OR MySql

User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

SqlLite OR MySql

Post 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?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: SqlLite OR MySql

Post by Antonio Linares »

Vilian,

Do you mean using FiveTouch or FWH ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post by vilian »

Fivetouch.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: SqlLite OR MySql

Post by Antonio Linares »

Vilian,

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

http://forums.fivetechsupport.com/viewt ... 21&start=0
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post 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?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: SqlLite OR MySql

Post by Antonio Linares »

QT provides support for SqlLite (FiveTouch uses QT):

https://katecpp.wordpress.com/2015/08/2 ... e-with-qt/
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post by vilian »

But Can I use the same way to use MySql ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: SqlLite OR MySql

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post 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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: SqlLite OR MySql

Post 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
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post by vilian »

In my directory of Fivetouch there are no files *.pro :(
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: SqlLite OR MySql

Post by cnavarro »

You do not have/use the project fivetouch.pro?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post by vilian »

No,
I'm using Fivetouch Version that Antônio has published here http://forums.fivetechsupport.com/viewt ... 32&t=35529
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: SqlLite OR MySql

Post by cnavarro »

vilian wrote:No,
I'm using Fivetouch Version that Antônio has published here http://forums.fivetechsupport.com/viewt ... 32&t=35529
Folder Windows, not?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: SqlLite OR MySql

Post by vilian »

This is evertyhing I have in Fivetouch directory:
Image
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Post Reply