In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Sqlite datasource for DBBrowse

Xailer professional forum in English
Responder
DC
Mensajes: 122
Registrado: Lun May 16, 2011 6:06 pm

Sqlite datasource for DBBrowse

Mensaje por DC »

Speaking of things I don't know how to do, how do we connect a Sqlite Dataset to a TDBBrowse?

7 minutes after the last post, I discovered I don't know how to add a defined Sqlite source to a TDBBrowse.

The existing Sqlite database is pointed to with the oConnect property in the TDBrowse. But the oDataSet property of the TDBBrowse won't accept the Sqlite Data Source oSqlite_AllFiles.

It doesn't show it in the picklist, and won't accept if it if it's typed manually.

The only table in the Sqlite database has more than 10 million records. Will that be a problem?
TDBBrowse_oDataSet.jpg
TDBBrowse_oDataSet.jpg (93 KiB) Visto 700 veces
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: Sqlite datasource for DBBrowse

Mensaje por Hurricane »

Hi,

1 - In TSQLiteDataSouce:
assign the full name of the DB file (:cConnect)

2 - add TSQLQuery:
define SQL statement (:cSelect)
assign/select the DataSource (:oDataSource)
activate (:lOpen) *

3 - In TDBBrowse:
assign/select the TSQLQuery (:oDataSet)
If there are no columns in the browse, they will be created automatically in the designer.

* Activate via code. You can enable via designer to see the data, but prefer to generate the EXE with this property disabled.
SQLQuery.png
SQLQuery.png (13.92 KiB) Visto 695 veces
Also see the examples:
Xailer\SAMPLES\DataControls\SQLite1
Xailer\SAMPLES\DataControls\SQLite2
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
DC
Mensajes: 122
Registrado: Lun May 16, 2011 6:06 pm

Re: Sqlite datasource for DBBrowse

Mensaje por DC »

Thanks, Hurricane. All that makes sense.

Unfortunately, when I try to active the query, about 7 seconds after Selecting lOpen = T, in the tSqlQuery Object, Xailer Enterprise abruptly exits, without saving the setting or popping up a warning.

I'll try shortening the number of rows, in case this is some kind of Virtual Memory issue.



There's also a linking problem. I won't worry about it until all the components are working, but am getting

Compiling: frm_AllFiles.prg...
Linking: SqliteViewer.exe...
C:/Xailer/Lib/libxailer.a(ISQLite.o):(.text+0x3b): undefined reference to `sqlite3_value_type'
C:/Xailer/Lib/libxailer.a(ISQLite.o):(.text+0x78): undefined reference to `sqlite3_value_text'
C:/Xailer/Lib/libxailer.a(ISQLite.o):(.text+0x88): undefined reference to `sqlite3_value_text'
...
and related errors.

1 Files, 0 Warnings, 162 Errors
Compile time: 0.70s Link time: 1.86s Total time: 2.57s

The project is probably not pointing to a library that's mentioned in the docs. This is the first time I tried using the Sqlite components, in a form. Everything else has been in code.


Anyway, thanks Hurriance. You got me a little further. I always expect a few hurdles, and trial & error, the first time around.


(Edit: The problem was the number of rows. It was about 17 million. That's fine, I can partition out this particular table into multiple tables)
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Sqlite datasource for DBBrowse

Mensaje por ignacio »

Hi,

I suppose you have included the sqlite library in your project. In case yes, please try to run any SQLite sample and tell us your results.

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
DC
Mensajes: 122
Registrado: Lun May 16, 2011 6:06 pm

Re: Sqlite datasource for DBBrowse

Mensaje por DC »

ignacio escribió: Dom Ene 23, 2022 9:42 pm Hi,

I suppose you have included the sqlite library in your project. In case yes, please try to run any SQLite sample and tell us your results.

Regards,
Thanks Ignacio,

I just checked on the sqlite library, and everything is compiling without errors.
Responder