Page 4 of 6
Re: MySQL and HMG
Posted: Sat Apr 25, 2009 5:13 pm
by Rathinagiri
I had got your code and found it very much useful Sudip. Thanks a lot for sharing the same. Gr8.
Re: MySQL and HMG
Posted: Sun Apr 26, 2009 2:26 am
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
Especially, if the code is written after a very busy day.
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
Re: MySQL and HMG
Posted: Sun Apr 26, 2009 8:08 am
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
Re: MySQL and HMG
Posted: Sun Apr 26, 2009 8:31 am
by Rathinagiri
Oh. Thanks.
Now, it is simple. Isn't it?
Re: MySQL and HMG
Posted: Tue May 26, 2009 6:00 am
by sudip
Hello,
How can I connect MySql database from the client computer connected through LAN?
TIA.
Regards.
Sudip
Re: MySQL and HMG
Posted: Tue May 26, 2009 6:24 am
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!
Re: MySQL and HMG
Posted: Tue May 26, 2009 6:37 am
by sudip
Thanks a lot!
Should I need to install MySql in client computer also?
Regards.
Sudip
Re: MySQL and HMG
Posted: Tue May 26, 2009 7:04 am
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...
Re: MySQL and HMG
Posted: Tue May 26, 2009 7:25 am
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.
Re: MySQL and HMG
Posted: Tue May 26, 2009 7:56 am
by mol
I think, this method overloads network and server. But, I think other applications (not HMG) are working with the same method.