MySQL and HMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: MySQL and HMG

Post by swapan »

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
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
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

Post by Rathinagiri »

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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
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

Post by Rathinagiri »

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.

Image
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post by sudip »

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!!! :D

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

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
User avatar
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

Post by Rathinagiri »

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. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post by sudip »

Rathinagiri 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. :)
Yes, I really want to see the codes :) ( I hope this will be helpful for DbCreaChk() function also)

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
User avatar
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

Post by Rathinagiri »

Here it is.

Since I am an amateur programmer, my way of doing is (r)tough.
dbf2mysql.zip
Data export from dbf to MySQL (Table must be in existence in MySQL database)
(3.04 KiB) Downloaded 369 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post by sudip »

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 !!! :shock:

With best regards.

Sudip
With best regards,
Sudip
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: MySQL and HMG

Post by swapan »

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.
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: You know? I had developed this converter in just three hours. That is the power of HMG. :)
I would add a bit more.... That is the power of Rathinagiri! :D
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post by sudip »

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
With best regards,
Sudip
Post Reply