FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SQLITE ODBC
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
SQLITE ODBC
Posted: Sat Jun 22, 2013 02:17 PM

Hello,

I am testing SQLite to be use with ADO.

I found this ODBC driver:

http://www.ch-werner.de/sqliteodbc/

Anyone is using it?.

Or another ODBC driver?.

Thank you very much.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: SQLITE ODBC
Posted: Sat Jun 22, 2013 03:42 PM

Hello,

I'm using it.
It's working very nice.

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: SQLITE ODBC
Posted: Sun Jun 23, 2013 10:31 AM

Marc,

What string for connection do you use?.

Also, have you found any particular issue?.

For example, I discover that function MONTH is not supported:

SELECT * FROM APUNTES WHERE MONTH(FECHA) = '1'

Any comment will be welcomed.

Thank you.

Best regards

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: SQLITE ODBC
Posted: Sun Jun 23, 2013 10:55 AM

Lucas,

As connectionstring I use:
Driver={SQLite3 ODBC Driver};Database=c:\temp\test.db;

Database=c:\temp\test.db is the SQlite-file.

I didn't use month in SQlite, but you can use something like FECHA>... AND FECHA< ...

There are indeed difference between MySQL and SQLite functions and syntax...

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: SQLITE ODBC
Posted: Sun Jun 23, 2013 11:56 AM

Thank you.

And where I please find those diferences?.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: SQLITE ODBC
Posted: Sun Jun 23, 2013 08:56 PM

Marc,

And how do you deal with dates?-

INSERT INTO bestand (DATA), VALUES DTOC(DATE()) shows nill on the record,

Thanks.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: SQLITE ODBC
Posted: Mon Jun 24, 2013 04:32 AM
Mr Lucas

You can make it simple if you use FWH13.05

Code (fw): Select all Collapse
#include "fwsqlcmd.ch"

...........

cSql := SQL INSERT INTO bestand (DATA), VALUES ( Date() ) 
// The above is translated into the syntax that SQL Server understands
// if you like you can examine by ? cSql
oCn:Execute( cSql )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: SQLITE ODBC
Posted: Mon Jun 24, 2013 05:02 AM
lucasdebeltran wrote:Marc,

And how do you deal with dates?-

INSERT INTO bestand (DATA), VALUES DTOC(DATE()) shows nill on the record,

Thanks.


You have to transform the date to 'YYYY-MM-DD'

Code (fw): Select all Collapse
INSERT INTO bestand (DATA), VALUES sqldate(DATE()) 

FUNCTION sqlddate(vdatum)
RETURN '"'+PadL( 聽Year( vdatum), 4, '0' )+'-'+PadL( Month( vdatum), 2, '0' )+'-'+PadL( 聽 Day( vdatum), 2, '0' )+'"'
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion