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?
Sqlite datasource for DBBrowse
Re: Sqlite datasource for DBBrowse
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.
Also see the examples:
Xailer\SAMPLES\DataControls\SQLite1
Xailer\SAMPLES\DataControls\SQLite2
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.
Also see the examples:
Xailer\SAMPLES\DataControls\SQLite1
Xailer\SAMPLES\DataControls\SQLite2
Re: Sqlite datasource for DBBrowse
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)
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)
- ignacio
- Site Admin
- Mensajes: 9256
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: Sqlite datasource for DBBrowse
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,
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,