Page 1 of 1
MariaDB, MySql o ProgresSql???
Posted: Tue Mar 21, 2023 12:37 am
by jorge_rivero
Hola a todos.
Necesito ayuda en lo siguiente:
-Trabajo con Harbour MiniGUI Extended Edition 23.02 (Release).
-Mi proyecto es desarrollar un Sistemas de Historias Clinicas.
-Al gunos medicos tienen que poder usar el sistema en forma remota hacia el servidor
-Mi duda es saber que tipo de base de datos usar (MariaDB, MySql o ProgresSql) para poder trabajar mejor de forma remota en algunas opciones.
-Si alguien tiene algun ejemplo simple de como llamar al servidor remoto y como hacerlo?
Les agradesco de corazon por la ayuda
Re: MariaDB, MySql o ProgresSql???
Posted: Tue Mar 21, 2023 7:09 am
by serge_girard
Jorge,
MariaDB = MySql.
I would go for MariaDB-MySql. Rather easy and well going for HMG and PHP.
Let me know if you need help.
Serge
Re: MariaDB, MySql o ProgresSql???
Posted: Tue Mar 21, 2023 9:18 pm
by tonton2
bonsoir tout le monde
J'avais un logiciel pour convertir des fichiers DBF dans une base de données .DB(mysql ou sqlite) contenant mes fichiers.dbf transformés en fichier sql
ce programme existe t- il dans notre hmgforum
merci à vous
translation by google
Good evening everyone
I had software to convert DBF files in to .DB(mysql or sqlite) database that containing my .dbf files transformed in to sql file
does this program exist in our hmgforum
thank you
Re: MariaDB, MySql o ProgresSql???
Posted: Tue Mar 21, 2023 9:22 pm
by tonton2
serge_girard wrote: ↑Tue Mar 21, 2023 7:09 am
Jorge,
MariaDB = MySql.
I would go for MariaDB-MySql. Rather easy and well going for HMG and PHP.
Let me know if you need help.
Serge
Bonsoir Serge,
Avez vous un exemple de base de données .DB(mysql) gerer avec hmg.344
Do you have an example of a .DB(mysql) database managed with hmg.344
Merci beaucoup
Re: MariaDB, MySql o ProgresSql???
Posted: Tue Mar 21, 2023 9:38 pm
by tonton2
Téléchargez mysqlc5.7 qui est compatible a HMG et installez le pilote ODBC MySQL sur votre ordinateur.
Download mysqlc5.7 and install the MySQL ODBC driver on your computer. You can download it from the MySQL website:
Code: Select all
#include "hmg.ch"
#include "hbodbc.ch"
/*Créez une connexion à la base de données MySQL en utilisant la fonction HB_ODBC_CONNECT(). Par exemple, vous pouvez ajouter le code suivant à votre programme pour vous connecter à une base de données MySQL nommée "test" :
Create a connection to the MySQL database using the HB_ODBC_CONNECT() function. For example, you can add the following code to your program to connect to a MySQL database named "test" */
cConnString := "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost;DATABASE=test;USER=root;PASSWORD=;OPTION=3;"
nConnHandle := HB_ODBC_CONNECT(cConnString)
j'espère que cela vous aidera
Bonne chance
Re: MariaDB, MySql o ProgresSql???
Posted: Tue Mar 21, 2023 9:59 pm
by dragancesu
I had software to convert DBF files in to .DB(mysql or sqlite) database that containing my .dbf files transformed in to sql file
does this program exist in our hmgforum
look this
http://hmgforum.com/viewtopic.php?t=510 ... 1&start=10
program myhmg.exe create -> import dbf create imp<dbfname>.prg program for create mysql table and insert data from dbf file
Maybe ODBC looks simpler, but I don't use it
Re: MariaDB, MySql o ProgresSql???
Posted: Wed Mar 22, 2023 8:06 am
by serge_girard
Simple conversion demo program:
Code: Select all
#include "hmg.ch"
IF SQL_Connect(XHI_HOST, XHI_USER, XHI_PAW, XHI_DBN) == Nil
MSGINFO("Not connected to SQL server! " , XHI_HOST)
RETURN
ENDIF
USE SOME_DBF_FILE ALIAS FX
SET FILTER TO DATUM <= dDATE1
GO TOP
nINS := 0
nTEL := 0
nERR := 0
// FILL SQL TABLE WITH SOME DBF RECORDS
DO WHILE .NOT. EOF()
cQuery2 := 'INSERT INTO SOME_SQL_FILE ('
cQuery2 += 'F1, F2, F3 ) '
cQuery2 += 'VALUES ('
cQuery2 += " '" + STRVALUE(FX->F1) + "', "
cQuery2 += " '" + STRVALUE(FX->F2) + "', "
cQuery2 += " '" + STRVALUE(FX->F3) + "') "
cSQL2 := cQuery2
cQuery2 := dbo:Query( cQuery2 )
IF cQuery2:NetErr() // DUPLICATES
IF 'DUPLICATE ENTRY' $ UPPER(cQuery2:Error())
// ALLOW OR NOT IS THE QUESTION
ELSE
nERR++
? cSQL2
? cQuery2:Error()
ENDIF
ELSE
nINS++
ENDIF
SKIP
ENDDO
CLOSE ALL
? 'Records', nTEL
? 'Inserts', nINS
? 'Errors ', nERR
cQuery1 := ' SELECT COUNT(*),F1 , F2 '
cQuery1 += ' FROM SOME_SQL_FILE '
cQuery1 += ' GROUP BY F1, F2 '
cQuery1 += ' ORDER BY 2, 3 ' // OR F1, F2
cSQL1 := cQuery1
cQuery1 := dbo:Query( cQuery1 )
IF cQuery1:NetErr()
? 'SQL ERROR ' , cQuery1:Error(), cSQL1
RETURN(.F.)
ENDIF
USE SOME_DBF_2 ALIAS FX
// FILL DBF FILE WITH SQL TABLE
FOR nZZ := 1 To cQuery1:LastRec()
aCurRow1 := cQuery1:GetRow(nZZ)
nCOUNT := STRVALUE(aCurRow1:fieldGet(1) )
cF1 := STRVALUE(aCurRow1:fieldGet(2) )
cF2 := STRVALUE(aCurRow1:fieldGet(3) )
APPEND BLANK
REPLACE NC WITH nCOUNT
REPLACE F1 WITH cF1
REPLACE F2 WITH cF2
NEXT
CLOSE ALL
SQL_DISCONNECT()
FUNCTION SQL_Connect()
/**********************************************/
dbname := 'YOUR_DBNAME'
HOST := 'YOUR_DBHOST'
user := 'YOUR_DBUSER'
password := 'YOUR_DBPASSW'
dbo := tmysqlserver():new(ALLTRIM(host),ALLTRIM(user),ALLTRIM(password))
IF dbo:NetErr()
RETURN nil
ENDIF
IF!EMPTY(dbname)
dbo:selectdb(dbname)
IF dbo:NetErr()
RETURN nil
ENDIF
ENDIF
cVersion := dbo:sql_Version()
RETURN dbo
FUNCTION SQL_Disconnect()
/************************/
dbo:Destroy()
RETURN
You will to have this file : libmysql.dll + database
Database: copy/install XAMPP
Very simple
Re: MariaDB, MySql o ProgresSql???
Posted: Wed Mar 22, 2023 8:40 pm
by tonton2
Merci beaucoup mes amis , c'est très instructifs