MySQL and HMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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 »

I had got your code and found it very much useful Sudip. Thanks a lot for sharing the same. Gr8.
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:I had got your code and found it very much useful Sudip. Thanks a lot for sharing the same. Gr8.
You know how happy I am, to know that from you :D

Especially, if the code is written after a very busy day. :D

Today is Sunday, but I have to create some entry modules and reports (created with another software tool :( ) to give the software tomorrow morning.

I shall wait for your finished dbf2mysql.

Thank you very much.

With best regards.

Sudip
With best regards,
Sudip
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 found some problem regarding date value. I changed your C2Sql functon.

Code: Select all

function C2SQL(Value)

   local cValue := ""
   local cFormatoDaData := set(4)
   do case
   case Valtype(Value) == "N"
      cValue := AllTrim(Str(Value))

   case Valtype(Value) == "D"
   	if !empty(Value)
   		cValue := "'"+DTOS(value)+"'"
   	else
   		cValue := "'00000000'"
   	endif
   case Valtype(Value) $ "CM"
      IF Empty( Value)
         cValue="''"
      ELSE
         cValue := "'"
         Value:=DATATOSQL(value)
         cValue+= value+ "'"
      ENDIF

   case Valtype(Value) == "L"
      cValue := AllTrim(Str(iif(Value == .F., 0, 1)))

   otherwise
      cValue := "''"                                // NOTE: Here we lose values we cannot convert

   endcase

   return cValue
Please check this and send your comments.

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 »

Oh. Thanks.

Now, it is simple. Isn't it?
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 »

Hello,

How can I connect MySql database from the client computer connected through LAN?

TIA.

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 »

1. The host name would be the name of the computer (not 'localhost') where MySQL server is installed.

2. Remember to add port number 3306 (default, change if changed) in the firewall table to allow it in both the machines.

That's all!
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 »

Thanks a lot! :)

Should I need to install MySql in client computer also?

Regards.

Sudip
With best regards,
Sudip
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: MySQL and HMG

Post by mol »

I think, you don't need to install mysql on client computer.

Hi Rathi!
I have a question - You are viewing mysql database with grid - all data is captured in a static table. But what about network working - where few users can work on the same database, all can add new records, delete or edit them? How do you refresh your view?

I always use Browse with *.dbf files - because browse is refreshing view automatically.

I have no experiences with mysql, but try to learn something new...
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 »

Yes. No need to install anything except the HMG application in the client computer.

Since MySQL is a back end server, always the user has to give request to get the result.

We have to manually refresh. If we want, we can do with a timer control to refresh frequently.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: MySQL and HMG

Post by mol »

I think, this method overloads network and server. But, I think other applications (not HMG) are working with the same method.
Post Reply