MySql Primer

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySql Primer

Post by sudip »

Hello,

I "re-initialized" my MySql journey. I am still using TMySqlServer! Tried HbSqlRdd, but decided to try it later. Meanwhile I came to know another library HBTIP from Roberto Lopez. It's harder but more secure. So, I am now working with TMySqlServer.

Today I added Add, Modify and Delete options to my MySql project. I used Insert key for Add, Dbl Click for Edit and Delete key to delete records. Very simple and basic project. Taken help from Rathi's code and some Idea from Demo_2 example.
mysql002.jpg
mysql002.jpg (120.48 KiB) Viewed 4458 times
Thank you Roberto Lopez, Rathinagiri, Grigory Filatov, Esgici (Esgici your comments always inspire me :))

Please download it.
Demo.zip
(3.51 KiB) Downloaded 394 times
Then compile and run.

And please send your advice.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MySql Primer

Post by Rathinagiri »

I had gone through your code and it is neat.

A small suggestion, perhaps not regarding MySQL.

Code: Select all

 @ 20,120 TEXTBOX txtHostName ;
         HEIGHT 25 ;
         VALUE cHostName ;
         WIDTH 120 ;			
      ON ENTER iif( !Empty(frmLogon.txtHostName.Value),  frmLogon.txtUser.SetFocus, frmLogon.txtHostName.SetFocus )

      @ 50,30 LABEL lblUser ;
         VALUE "User" ;
         WIDTH 120 ;
         HEIGHT 35

      @ 50,120 TEXTBOX  txtUser ;
         HEIGHT 25 ;
         VALUE cUser ;
         WIDTH 120 ;
         ON ENTER iif( !Empty(frmLogon.txtUser.Value), frmLogon.txtPassword.SetFocus, frmLogon.txtuser.SetFocus  )

      @ 80,30 LABEL lblPassword ;
         VALUE "Password" ;
         WIDTH 120 ;
         HEIGHT 35

      @ 80,120 TEXTBOX txtPassword ;
         VALUE cPassWord ;
         PASSWORD ;
         ON ENTER frmLogon.cmdLogin.SetFocus
IMHO, you need not give Setfocus command for every control, since the natural order of tab would be in the defined order of the controls. If you want to check the value, you can use 'valid' clause.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySql Primer

Post by sudip »

rathinagiri wrote:I had gone through your code and it is neat.

A small suggestion, perhaps not regarding MySQL.

IMHO, you need not give Setfocus command for every control, since the natural order of tab would be in the defined order of the controls. If you want to check the value, you can use 'valid' clause.
Thank you Rathi for checking codes thoroughly and sending advice for improvement!!! I like it so much :)

This is the problem of Copy-Paste programming.;) I copied that part (and slightly modified) from Demo_2!!! :)

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 Primer

Post by swapan »

Great going Sudip!

Hope your this thread will be a great help for the members who want to give a try to MySQL - the free RDBMS!

Regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: MySql Primer

Post by t57042 »

Hello Sudip,

trying to compile your code.
Get errormessage fro line : Value:=DATATOSQL(value): unknown function.

rgds
Richard
User avatar
serge_girard
Posts: 3167
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: MySql Primer

Post by serge_girard »

Richard,

It will be something like this code:

Code: Select all

XDATUM = DTOC(XDATUM)
XDATUM = SUBSTR(XDATUM,7,4) + '-' + SUBSTR(XDATUM,4,2) + '-' + SUBSTR(XDATUM,1,2)  

IF XDATUM = '    -  -  '
	XDATUM = 'NULL'
ENDIF
RETURN (XDATUM)
Serge
There's nothing you can do that can't be done...
Post Reply