MySQL and HMG
Moderator: Rathinagiri
Re: MySQL and HMG
I would appreciate if Rathi or any1 discuss how the following situations get handled in MySQL:
1) How to import data from DBFs
a) entire dbfs in its native form to be imported
(in ms platform:dbfs->msaccess->mssql can be done)
b) only import data from dbfs
2)Import/Export Data from one MySQL database to another MySQL database
With regards,
Swapan
1) How to import data from DBFs
a) entire dbfs in its native form to be imported
(in ms platform:dbfs->msaccess->mssql can be done)
b) only import data from dbfs
2)Import/Export Data from one MySQL database to another MySQL database
With regards,
Swapan
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: MySQL and HMG
Hi Swapan,
I had written my own HMG dbf2mysql converter, so that, if you specify the hostname, username, password and selected the database, any database table can be easily exported to MySQL.
If we have the structure already there, my dbf2mysql converter asks to match the dbf field(s) with the MySQL table fields to export to. For an idea I shall post a screenshot for you to understand.
You know? I had developed this converter in just three hours. That is the power of HMG.
From one MySQL database to another database, if you have access to both the databases, a simple "insert into" query would do the needful.
I had written my own HMG dbf2mysql converter, so that, if you specify the hostname, username, password and selected the database, any database table can be easily exported to MySQL.
If we have the structure already there, my dbf2mysql converter asks to match the dbf field(s) with the MySQL table fields to export to. For an idea I shall post a screenshot for you to understand.
You know? I had developed this converter in just three hours. That is the power of HMG.

From one MySQL database to another database, if you have access to both the databases, a simple "insert into" query would do the needful.
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.
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: MySQL and HMG
Here is a screen shot of my dbf2mysql converter. As of now, it caters the needs of me. I have to work more on this to make it generalized. Only then, I can share the code and executables.


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: MySQL and HMG
Hi Rathi,
Thank you for telling about your dbf2mysql. IMHO, converting dbf table to a "new" mysql table is simple with HMG and TMySql library (even with my limited knowledge
). Please don't take it otherwise. I was searching for how to convert a dbf into mysql table "easily" for 9 years!!! But, with HMG and YOUR HELP, I am able to do this now
(thanks a lot!!!)
(Even one year before I used to convert a dbf into Excel or MsSql first then convert them into MySql using ODBC!!!)
The main problem is to convert a dbf table to an "existing" mysql table. The screen shot explains some parts of it. And this is excellent!!!
And creating it within 3 hrs is mind blowing!!!
Regarding sharing, it reminds me an old Chinese proverb:-
"Give a man a fish, you feed him for a day. But show a man how to fish, you feed him for the life."
I like the 2nd part of the proverb. You already showed me "how to fish"
BTW, I started my Shopping Mall project, but it is in too initial stage to post even the screen shot!!!
Regarding DbCreaChk() function, main logic is clear to me, now I need to have some time to implement it.
Regards.
Sudip
Thank you for telling about your dbf2mysql. IMHO, converting dbf table to a "new" mysql table is simple with HMG and TMySql library (even with my limited knowledge


(Even one year before I used to convert a dbf into Excel or MsSql first then convert them into MySql using ODBC!!!)
The main problem is to convert a dbf table to an "existing" mysql table. The screen shot explains some parts of it. And this is excellent!!!

And creating it within 3 hrs is mind blowing!!!

Regarding sharing, it reminds me an old Chinese proverb:-
"Give a man a fish, you feed him for a day. But show a man how to fish, you feed him for the life."
I like the 2nd part of the proverb. You already showed me "how to fish"

BTW, I started my Shopping Mall project, but it is in too initial stage to post even the screen shot!!!

Regarding DbCreaChk() function, main logic is clear to me, now I need to have some time to implement it.
Regards.
Sudip
With best regards,
Sudip
Sudip
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: MySQL and HMG
Thanks for the nice words Sudip.
Actually, this is used for an existing table only. Table shall be created using any MySQL Client like Administrator or Query Browser.
From dbf to MySQL table, my small converter can do well. If you want I can share my (raw) code.
Actually, this is used for an existing table only. Table shall be created using any MySQL Client like Administrator or Query Browser.
From dbf to MySQL table, my small converter can do well. If you want I can share my (raw) code.

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: MySQL and HMG
Yes, I really want to see the codesRathinagiri wrote: Actually, this is used for an existing table only. Table shall be created using any MySQL Client like Administrator or Query Browser.
From dbf to MySQL table, my small converter can do well. If you want I can share my (raw) code.

Thank you Rathi. It will be extremely helpful for me (and others who are also learning HMG + MySql)
In my humble experience, seeing codes, (understanding and working on it for improvement) created by others who are more advanced in an area of software development is extremely helpful for learning any software tool (language, library etc).
BTW, I am a fan of Esgici's style of coding - simple and effective.
Thank you again.
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: MySQL and HMG
Here it is.
Since I am an amateur programmer, my way of doing is (r)tough.
Since I am an amateur programmer, my way of doing is (r)tough.
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: MySQL and HMG
Hi Rathi,
Thank you very much for sharing your excellent code. I downloaded it and went thru the codes. Codes are very good not "Amateurish" as you told. I learned many things from the codes.
I like your straight forward way of programming. It's my way!
Before downloading, I thought to use TableStruct(), CreateTable() functions. But I found that you used sql commands very efficiently. So, this can be ported to other SQL databases more easily (IMHO).
I shall use this "new knowledge" in my projects also.
Bye for now. One of my clients (a big foot wear manufacturer) told me to create a software within 2 days for their upcoming whole-sale showroom !!!
With best regards.
Sudip
Thank you very much for sharing your excellent code. I downloaded it and went thru the codes. Codes are very good not "Amateurish" as you told. I learned many things from the codes.

I like your straight forward way of programming. It's my way!
Before downloading, I thought to use TableStruct(), CreateTable() functions. But I found that you used sql commands very efficiently. So, this can be ported to other SQL databases more easily (IMHO).

I shall use this "new knowledge" in my projects also.
Bye for now. One of my clients (a big foot wear manufacturer) told me to create a software within 2 days for their upcoming whole-sale showroom !!!

With best regards.
Sudip
With best regards,
Sudip
Sudip
Re: MySQL and HMG
Thanks Rathi for the details..actually I asked because such situations we may have to face when we work with MySQL in real world projects.rathinagiri wrote:Hi Swapan,
I had written my own HMG dbf2mysql converter, so that, if you specify the hostname, username, password and selected the database, any database table can be easily exported to MySQL.
If we have the structure already there, my dbf2mysql converter asks to match the dbf field(s) with the MySQL table fields to export to. For an idea I shall post a screenshot for you to understand.
You know? I had developed this converter in just three hours. That is the power of HMG.
From one MySQL database to another database, if you have access to both the databases, a simple "insert into" query would do the needful.
I would add a bit more.... That is the power of Rathinagiri!rathinagiri wrote: You know? I had developed this converter in just three hours. That is the power of HMG.![]()

Re: MySQL and HMG
Hello Rathi,
I just created my "simplified" DBF to MySql covertion software!!! Thank you very much for your help.
This software checks if mysql has the same table. If it doesn't exists then creates it and if it exits tries to add records from dbf table. Very simple.
I created the software after a very busy day. I used some of your functions. Please check it in My HMG Projects forum and send your comments.
Regards.
Sudip
I just created my "simplified" DBF to MySql covertion software!!! Thank you very much for your help.
This software checks if mysql has the same table. If it doesn't exists then creates it and if it exits tries to add records from dbf table. Very simple.

I created the software after a very busy day. I used some of your functions. Please check it in My HMG Projects forum and send your comments.

Regards.
Sudip
With best regards,
Sudip
Sudip