DBF<-->SQLite Exporter
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: DBF<-->SQLite Exporter
Hi,
It is not the .hbp file, but the .hbc file is important.
Further, I have updated to the new version of DBF <---> SQLite Explorer to export all the tables in a SQLite file into respective dbf files.
Note: Width of Field Names in DBF files is truncated to 10 characters.
Enjoy!
It is not the .hbp file, but the .hbc file is important.
Further, I have updated to the new version of DBF <---> SQLite Explorer to export all the tables in a SQLite file into respective dbf files.
Note: Width of Field Names in DBF files is truncated to 10 characters.
Enjoy!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: DBF<-->SQLite Exporter
rathinagiri, Chacal.GO I am grateful for the help, it can be run.
Chacal.GO wrote:Hello bels79 !
You just need to edit file: dbf2sqlite.hbp ( can be edited via HMG IDE )
If you dont have "HMGSQL LIB" just download from link below:
viewtopic.php?f=8&t=1562&p=12079&hilit=HmgSql#p12079
dbf2sqlite.hbp - before changes:dbf2sqlite.hbp - After changes:Code: Select all
main.prg sqlite2dbf.prg
Code: Select all
main.prg sqlite2dbf.prg # # libs # # -lhbsqlit3 # # .hbc files # # hbsqlit3.hbc dbf2sqlite.hbc
Re: DBF<-->SQLite Exporter
Hello bels79 !
Please: can you explain any dificulties found ?
Regards...
Please: can you explain any dificulties found ?
Regards...
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
Re: DBF<-->SQLite Exporter
I tried according to the instructions given, delete command "CFLAGS = -Wall -mno-cygwin -O3 " on file "makefile.gcc"
Chacal.GO wrote:Hello bels79 !
Please: can you explain any dificulties found ?
Regards...
Re: DBF<-->SQLite Exporter
Then... new instructions:
01 - Copy project to your samples HMG folder
-> \HMG\SAMPLES\Dbf2Sqlite
02 - Command Prompt: (or build from HMG ide)
\HMG\SAMPLES\..\..\build.bat Dbf2Sqlite.hbp
03 - Now you have built Dbf2Sqlite... enjoy
\HMG\SAMPLES\Dbf2Sqlite.exe
Regards...
01 - Copy project to your samples HMG folder
-> \HMG\SAMPLES\Dbf2Sqlite
02 - Command Prompt: (or build from HMG ide)
\HMG\SAMPLES\..\..\build.bat Dbf2Sqlite.hbp
03 - Now you have built Dbf2Sqlite... enjoy
\HMG\SAMPLES\Dbf2Sqlite.exe
Regards...
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: DBF<-->SQLite Exporter
Or simply use HMG-IDE, open and build the project.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: DBF<-->SQLite Exporter
Hello Rathinagiri,rathinagiri wrote:Hi,
It is not the .hbp file, but the .hbc file is important.
Further, I have updated to the new version of DBF <---> SQLite Explorer to export all the tables in a SQLite file into respective dbf files.
Note: Width of Field Names in DBF files is truncated to 10 characters.
Enjoy!
I just download and tried the DBF->SQLite converter but it does not recognize datatype + (auto-increment) - It was introduced on this changelog:
2007-09-25 03:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
...
* harbour/source/rdd/dbf1.c
+ added support for AUTOINC (+), ROWVERSION (^), TIME (T), DAYTIME (@)
and MODTIME (=) fields
...
It is interesting feature - you should check it.
Could you please add it to this nice utility?
Thanks
Qatan
Harbour | GTWVT | MingW | Visual Studio Code
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: DBF<-->SQLite Exporter
Dear Qatan,
For your kind information, I am not using the RDD. I directly connect with hbsqlite library.
For your kind information, I am not using the RDD. I directly connect with hbsqlite library.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: DBF<-->SQLite Exporter
Hello Rathinagiri,
I think you didn't understand.
It talks about new datatypes in DBF fields. Before there were only C, L, N, M and D but now we have a few more. The auto increment is type | + | and is very useful.
What I wanted to express is that the DBF<-->SQLite Exporter utility does not know this new DBF datatype + so it gives an error (type not recognized or something like that...)
I was asking you if it is possible that you could update your nice utility to understand the new DBF datatypes. Do you think it is possible? I like your utility and I think it could support these new datatypes...
By the way I am considering to try some special features of SQLite:
1) Integration with ICU with localization features for finding "A" and "á" as the same thing: http://www.sqlite.org/src/artifact?ci=t ... README.txt
(also "a", "ã", "Â", "À", "â", etc... and goes to "o", "O", "ó", etc... etc...)
2) Integration with SQLCypher http://sqlcipher.net/ (I remember you succeded with this one, if I am not wrong)
3) FTS (Fast Text Search) feature: http://www.sqlite.org/fts3.html
I think SQLite is very good and what I like most is the simplicity of it (zero config), only one file for all tables and of course blazing fast. A query like this one in a big database is super fast:
SELECT * FROM table1 WHERE field1 LIKE '%core%' OR field2 LIKE '%core%' OR field3 LIKE '%core%' ORDER BY field4
The above query seeks for word "core" in many fields and in any part of the field way faster than using DBFNSX with OrdWildSeek()
Of course it demands a lot of research and try but a program using SQLite with the above features would be very nice. I would appreciate any previous experience with any of the above (of all of them)
Right now I can not do the above query to search for the following data (I am missing ICU component):
coré
corè
córe
côre
etc...
By the way you can use ICU component in the DBF files also:
2012-04-20 17:52 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
...
* harbour/src/codepage/cp_utf8.c
+ harbour/src/codepage/uc16def.c
+ harbour/src/codepage/utf8sort.c
* replaced UTF8ASC with new CP: UTF8EX
This CP uses character indexes instead of bytes one
and operates on unicode characters flags.
Tables for upper/lower conversions and upper/lower/alpha/digit
flags were generated automatically from
http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
It also uses custom collation rules. It's very simple one
level sorting based on UTF8 C collation.
If someone needs some advanced sorting rules, then it's enough
to create copy of this cp with user custom version of UTF8_cmp()
and UTF8_cmpi() functions, i.e. they can be redirected to some
external library like ICU (icu-project.org).
...
Also I can not encrypt the database so anyone can open it and see/modify it with a simple utility what could cause inconsistencies not to mention it would not protect the information on the database being accessed by anyone (in special in a shared folder on the network).
The FTS feature would just be an extra.
Thanks for your help
Qatan
I think you didn't understand.
It talks about new datatypes in DBF fields. Before there were only C, L, N, M and D but now we have a few more. The auto increment is type | + | and is very useful.
What I wanted to express is that the DBF<-->SQLite Exporter utility does not know this new DBF datatype + so it gives an error (type not recognized or something like that...)
I was asking you if it is possible that you could update your nice utility to understand the new DBF datatypes. Do you think it is possible? I like your utility and I think it could support these new datatypes...
By the way I am considering to try some special features of SQLite:
1) Integration with ICU with localization features for finding "A" and "á" as the same thing: http://www.sqlite.org/src/artifact?ci=t ... README.txt
(also "a", "ã", "Â", "À", "â", etc... and goes to "o", "O", "ó", etc... etc...)
2) Integration with SQLCypher http://sqlcipher.net/ (I remember you succeded with this one, if I am not wrong)
3) FTS (Fast Text Search) feature: http://www.sqlite.org/fts3.html
I think SQLite is very good and what I like most is the simplicity of it (zero config), only one file for all tables and of course blazing fast. A query like this one in a big database is super fast:
SELECT * FROM table1 WHERE field1 LIKE '%core%' OR field2 LIKE '%core%' OR field3 LIKE '%core%' ORDER BY field4
The above query seeks for word "core" in many fields and in any part of the field way faster than using DBFNSX with OrdWildSeek()
Of course it demands a lot of research and try but a program using SQLite with the above features would be very nice. I would appreciate any previous experience with any of the above (of all of them)
Right now I can not do the above query to search for the following data (I am missing ICU component):
coré
corè
córe
côre
etc...
By the way you can use ICU component in the DBF files also:
2012-04-20 17:52 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
...
* harbour/src/codepage/cp_utf8.c
+ harbour/src/codepage/uc16def.c
+ harbour/src/codepage/utf8sort.c
* replaced UTF8ASC with new CP: UTF8EX
This CP uses character indexes instead of bytes one
and operates on unicode characters flags.
Tables for upper/lower conversions and upper/lower/alpha/digit
flags were generated automatically from
http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
It also uses custom collation rules. It's very simple one
level sorting based on UTF8 C collation.
If someone needs some advanced sorting rules, then it's enough
to create copy of this cp with user custom version of UTF8_cmp()
and UTF8_cmpi() functions, i.e. they can be redirected to some
external library like ICU (icu-project.org).
...
Also I can not encrypt the database so anyone can open it and see/modify it with a simple utility what could cause inconsistencies not to mention it would not protect the information on the database being accessed by anyone (in special in a shared folder on the network).
The FTS feature would just be an extra.
Thanks for your help
Qatan
Harbour | GTWVT | MingW | Visual Studio Code
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: DBF<-->SQLite Exporter
Thanks a lot for the detailed explanation Qatan.
I didn't use DBF autoincrement fields. So I didn't know about that. I will dig into it and make use of it.
1. Regarding ICU, unfortunately HMG is not ready for Unicode implementation even though Harbour is. There are many places to be changed for unicode implementation.
2. SQLCipher is possible now. You can encrypt/decrypt the whole database on the fly without any hustle. You can download the library and details from here.
viewtopic.php?f=7&t=2416
3. Will FTS be possible without ICU?
Regarding encryption and decryption I have coded a small utility if you have installed the SQLCipher properly.
I didn't use DBF autoincrement fields. So I didn't know about that. I will dig into it and make use of it.
1. Regarding ICU, unfortunately HMG is not ready for Unicode implementation even though Harbour is. There are many places to be changed for unicode implementation.
2. SQLCipher is possible now. You can encrypt/decrypt the whole database on the fly without any hustle. You can download the library and details from here.
viewtopic.php?f=7&t=2416
3. Will FTS be possible without ICU?
Regarding encryption and decryption I have coded a small utility if you have installed the SQLCipher properly.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.