Migrate from DBFCDX TO SQL
Moderator: Rathinagiri
- fouednoomen
- Posts: 188
- Joined: Sun Oct 14, 2012 8:33 am
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
- Location: Tunisia
Migrate from DBFCDX TO SQL
Dear Friends
Can anyone help me to Migrate from DBFCDX to MySql or Sqlite for
my first project (Client)
Please look at attached project build with DBFCDX , i put also the sqlite
database (Mydbase.db) with 2 tables client and reprsen
regards
Foued
Can anyone help me to Migrate from DBFCDX to MySql or Sqlite for
my first project (Client)
Please look at attached project build with DBFCDX , i put also the sqlite
database (Mydbase.db) with 2 tables client and reprsen
regards
Foued
- Attachments
-
- client.rar
- (981.9 KiB) Downloaded 449 times
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Migrate from DBFCDX TO SQL
Hi,
Except "Do Report", I had implemented SQLite version of your code. Please see.
For your kind information, it took 1 hour to modify.
If you want to modify this to MySQL, you need not change anything except the connection in main.prg line no 54 and replacement of hmgmysql for hmgsqlite in libs.
Except "Do Report", I had implemented SQLite version of your code. Please see.
For your kind information, it took 1 hour to modify.
If you want to modify this to MySQL, you need not change anything except the connection in main.prg line no 54 and replacement of hmgmysql for hmgsqlite in libs.
Code: Select all
oDB := connect2db( 'localhost', cUserName, cPassword, 'mydatabase' )
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.
- fouednoomen
- Posts: 188
- Joined: Sun Oct 14, 2012 8:33 am
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
- Location: Tunisia
Re: Migrate from DBFCDX TO SQL
Hi Radhi ,
Many thanks for prompt help it's run like i need ,
I appreciate very much you help because i need to
know how i can start . As when i start with hmg to migrate all my projects from clipper , on the beginning it seems difficult but when some one help me to start it becomes easy day per day .
Best regards
Foued
Many thanks for prompt help it's run like i need ,
I appreciate very much you help because i need to
know how i can start . As when i start with hmg to migrate all my projects from clipper , on the beginning it seems difficult but when some one help me to start it becomes easy day per day .
Best regards
Foued
Re: Migrate from DBFCDX TO SQL
Thank you, Rathirathinagiri wrote:Hi,
Except "Do Report", I had implemented SQLite version of your code. Please see.
For your kind information, it took 1 hour to modify.
If you want to modify this to MySQL, you need not change anything except the connection in main.prg line no 54 and replacement of hmgmysql for hmgsqlite in libs.
Code: Select all
oDB := connect2db( 'localhost', cUserName, cPassword, 'mydatabase' )
Very helpful
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Migrate from DBFCDX TO SQL
Now I had included 'do report' part also.
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.
- fouednoomen
- Posts: 188
- Joined: Sun Oct 14, 2012 8:33 am
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
- Location: Tunisia
Re: Migrate from DBFCDX TO SQL
Hi Radhi
Many thanks for this effort
I'm sure all members of our forum will benefited by this workshop
Also i add a small modification to search client with name or a part of name
*------------------------------------------------------------*
Procedure Find()
*------------------------------------------------------------*
Local Find
Find := Upper (AllTrim(InputBox( 'Code/Raison Client:' , 'Chercher un Client' )))
If .Not. Empty(Find)
aTable := sql( oDB, 'select * from client where cod_cli = ' + c2sql( find ) )
if len( aTable ) > 0
for i := 1 to win_1.browse_1.itemcount
if alltrim( win_1.browse_1.cell( i, 1 ) ) == alltrim( find )
win_1.browse_1.value := i
exit
endif
next i
else
Find:=Find+'%'
aTable := sql( oDB, 'select * from client where raison like ' + c2sql( find ) )
if len( aTable ) > 0
for i := 1 to win_1.browse_1.itemcount
if left(win_1.browse_1.cell( i, 2 ),len(find)-1) == left( find,len(find)-1 )
win_1.browse_1.value := i
exit
endif
next i
else
MsgExclamation('Code Client Enexistant')
endif
endif
endif
Return
*------------------------------------------------------------*
Best regards
Foued
Many thanks for this effort
I'm sure all members of our forum will benefited by this workshop
Also i add a small modification to search client with name or a part of name
*------------------------------------------------------------*
Procedure Find()
*------------------------------------------------------------*
Local Find
Find := Upper (AllTrim(InputBox( 'Code/Raison Client:' , 'Chercher un Client' )))
If .Not. Empty(Find)
aTable := sql( oDB, 'select * from client where cod_cli = ' + c2sql( find ) )
if len( aTable ) > 0
for i := 1 to win_1.browse_1.itemcount
if alltrim( win_1.browse_1.cell( i, 1 ) ) == alltrim( find )
win_1.browse_1.value := i
exit
endif
next i
else
Find:=Find+'%'
aTable := sql( oDB, 'select * from client where raison like ' + c2sql( find ) )
if len( aTable ) > 0
for i := 1 to win_1.browse_1.itemcount
if left(win_1.browse_1.cell( i, 2 ),len(find)-1) == left( find,len(find)-1 )
win_1.browse_1.value := i
exit
endif
next i
else
MsgExclamation('Code Client Enexistant')
endif
endif
endif
Return
*------------------------------------------------------------*
Best regards
Foued
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Migrate from DBFCDX TO SQL
Thank you.
Here I have told about the common pattern of a HMG prg file. That pattern is exactly found here too.
Here I have told about the common pattern of a HMG prg file. That pattern is exactly found here too.
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: Migrate from DBFCDX TO SQL
While compiling following error, what is missing ?
hbmk2: Error: Referenced, missing, but unknown function(s): CONNECT2DB(),
SQL(), C2SQL(), MISCSQL()
hbmk2: Error: Referenced, missing, but unknown function(s): CONNECT2DB(),
SQL(), C2SQL(), MISCSQL()
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Migrate from DBFCDX TO SQL
In the project.hbc file you have to add the following line.
libs=hmgsqlite
libs=hmgsqlite
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: Migrate from DBFCDX TO SQL
Thank you for suggestionrathinagiri wrote:In the project.hbc file you have to add the following line.
libs=hmgsqlite
libs=hmgsqlite was in the project.hbc but it worked after inclusion in the hmg.hbc, why ?
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG