Page 1 of 1

Lazarus + WinCE + SQLite remote database

Posted: 12.11.2007, 22:35
by kakarotv5
I want to build with Lazarus a program for WinCE that works with a SQLite remote database.

I have created a web server, I have used Apache 2.2.6

The address of my web server is this.

In the web server I have put a SQLite database.

I want to connect to the SQLite database with a program made under Lazarus for WinCE but I do not know how do it.

I already know how to connect to the database if it is in the hard disk, but I do not know how to connect to the database if it is in the web server.

How I can do it?

What I need?

Can anybody help me?

Thanks.

Regards.

Posted: 13.11.2007, 21:08
by mdaems
Hi,

As SQLite does not support remote connections, you will have to use some program on the apache server that serves the data from the database to your lazarus program. As far as I understand in Delphi this is done by using a ClientDataset on the remote site and a DatasetProvider at the server side. I'm not sure similar componets are available in Lazarus. (I'm afraid not)

Mark

Posted: 13.11.2007, 21:28
by kakarotv5
Thanks to respond to me.
mdaems wrote:As SQLite does not support remote connections
If I use ZEOSLib ¿I do not connect to a remote database?

I thought that if I used ZEOSLib then I could connect to a remote database.

Thanks.

Best regards.

Posted: 14.11.2007, 18:29
by martinrame
Yes, Zeos allows you to connect to remote database servers. But SQLite is not a server, just a local databse engine.

If you try to connect to a remote MySql or Postgresql, you can do with ZEOS.

Leonardo

Posted: 14.11.2007, 21:40
by kakarotv5
Then why to use ZEOS and SQLite?

What we can do with ZEOS and SQLite?

Thanks.

Regards.

Posted: 14.11.2007, 21:59
by mdaems
Generally: You could use Zeoslib to access SQLite as any other supported database engine. The only difference are the connection parameters. Other components are used the same way whatever server you use. (Of course, DB specific syntax in queries isn't portable) The only limitation is inherent to SQLite : only databases on the filesystem of your program are supported.

In your case :
You could use zeoslib to write a data broker for your remote application. As said before : when you had been using Delphi you could have used the DatasetProvider component. Please have a look around. Probably there are FPC equivalents available. And, if they are not available : consider a database change over writing your own broker. Firebird and Mysql are good alternatives for SQLite in combination with Zeoslib.
An other solution would be to write a web based application (if that's possible using Lazarus). In that case all logic runs on your server, where you can use zeos+SQLite.

Mark

Posted: 02.12.2007, 03:53
by kakarotv5
Thank you very much.