Fw: Tdolphing MySql y Harbour

331 views
Skip to first unread message

Qatan

unread,
Sep 10, 2010, 3:28:36 PM9/10/10
to harbou...@googlegroups.com
Hello,
   
    I found the following information about a new MySql Class on the xHarbour Spanish/Portuguese news and thought it could be somehow valuable to someone.
 
Qatan
 
 
 
 
Follows (Spanish and English)
 
Una informacion importante para todos los desarrolladores de Harbour,
por favor pasense por este foro , ya cree mi primera aplicacion con
xharbour + Fwh + Mysql y es fantastico tambien funciona sin FWH.

Atentamente

Nicanor Martinez

TDolphin, Class to manager MySql

Postby Daniel Garcia-Gil » Thu Jul 01, 2010 3:18 pm
Hi...

TDolphin is a class designed for compilers Harbour / xHarbour to manage
MySql TDolphin, is designed to reduce lines of code, debug and easy to
make better use of the power of MySql
i'm not try to use or simulate a MySql as DBF, we do not want to miss
the entire capacity of MySql, but you can find similar code classes that
handle DBFs
If you have used TMySql be easier to adapt to TDolphin, though by itself
is very easy to use
TDolphin is integrated by 2 class, TDolphinSrv: To Host control and
TDolphinQry: To Queries control
the better is the source code is all avalaible
For the examples we have used Harbour, xHarbour y Fivewin for [x]Harbour
This class has been made possible by the unconditional collaboration and
contributions of William Morales

is in testing period, any help will be welcome

http://tdolphin.blogspot.com/

gvar...@gmail.com

unread,
Apr 16, 2020, 12:36:32 AM4/16/20
to Harbour Users
Hi / Hola:

ENV.:
D:\tdolphin\samples>c:\hb32\bin\harbour -build
Harbour 3.2.0dev (r1909110816)
Copyright (c) 1999-2019, https://harbour.github.io/

Harbour Build Info
---------------------------
Version: Harbour 3.2.0dev (r1909110816)
Compiler: MinGW GNU C 7.3 (32-bit)
Platform: Windows 7 6.1 SP1
PCode version: 0.3
ChangeLog last entry: 2019-09-11 10:16 UTC+0200 Aleksander Czajczynski (hb fki.pl)
ChangeLog ID: 21bc2e0659c1ba5fdc9ffa39142584f8c24d2c6f
Built on: Sep 23 2019 10:52:02
Build options: (Clipper 5.3b) (Clipper 5.x undoc)
---------------------------
[ENG] By GoogleTranslator

I am trying to use MySQL with harbor using the tDolphin class (http://tdolphin.blogspot.com/).

I've managed to create the LIB (with setenvhg.bat), and some examples (with setenvhg.bat and bldcon.bat), using the build tools (BAT files), which come with the class.

As a next step, I need to incorporate the class into a small system that works in console mode, the same one that I build with an HBP file using the hbmk2 tool.

So, to standardize the tools I use, I now try to build the LIB and the examples using the hbmk2 tool.

I build an example (previously created with setenvhg.bat and bldcon.bat), now using hbmk2, using the following command:

D:\tdolphin\samples>c:\hb32\bin\hbmk2 listdbs.prg xhb.hbc -i..\include -LD:\tdolphin\lib\HARBOUR\MINGW32 -ldolphin -llibmysql -LD:\tdolphin\dll -rebuild -info 

and the EXE is created and it works without any problem.

Now I try to generate the LIB using the following file tdolphin.hbp which contains the following:

=====================tdolphin.hbp START
-info  
-hblib 
-inc
-odolphin
-incpath=.\include
-llibmysql 
-LD:\tdolphin\dll 

-D__WIN__
-q0

xhb.hbc

.\source\prg\tdolpexp.prg
.\source\prg\tdolpqry.prg
.\source\prg\tdolpsrv.prg

.\source\c\function.c
.\source\c\gerrapi.c

.\source\lang\msgen.c
.\source\lang\msges.c

=====================tdolphin.hbp END

This is part of the Result of the process:

--------------------------------------------------------------
D:\tdolphin>c:\hb32\bin\hbmk2 tdolphin.hbp -rebuild
hbmk2: Procesando: c:\hb32\contrib\xhb\xhb.hbc
hbmk2: Procesando: c:\hb32\contrib\hbct\hbct.hbc
hbmk2: Procesando: c:\hb32\contrib\hbtip\hbtip.hbc
hbmk2: Procesando: c:\hb32\contrib\hbfship\hbfship.hbc
hbmk2: Procesando: c:\hb32\contrib\hbxpp\hbxpp.hbc
hbmk2: Procesando: c:\hb32\contrib\hbwin\hbwin.hbc
hbmk2: Harbour: Compilando módulos...
hbmk2: Compilando...
In file included from ../../../source/c/function.c:61:0:
../../../include/mysql.h:63:19: error: unknown type name 'SOCKET'
 #define my_socket SOCKET
                   ^
../../../include/mysql_com.h:268:3: note: in expansion of macro 'my_socket'
   my_socket fd;     /* For Perl DBI/dbd */
   ^~~~~~~~~
../../../include/mysql.h:63:19: error: unknown type name 'SOCKET'
 #define my_socket SOCKET
                   ^
../../../include/mysql_com.h:437:16: note: in expansion of macro 'my_socket'
 int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
                ^~~~~~~~~
../../../source/c/function.c:77:40: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
 const char * SQL2ClipType( long lType, BOOL bLogical );
                                        ^~~~
                                        HB_BOOL
../../../source/c/function.c: In function 'HB_FUN_VAL2ESCAPE':
../../../source/c/function.c:255:4: error: unknown type name 'ULONG'; did you mean 'HB_ULONG'?
    ULONG iSize, iFromSize ;
    ^~~~~
    HB_ULONG
../../../source/c/function.c:257:4: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
    BOOL bResult = FALSE ;
    ^~~~
    HB_BOOL
../../../source/c/function.c:257:19: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
    BOOL bResult = FALSE ;
                   ^~~~~
                   FILE
../../../source/c/function.c:257:19: note: each undeclared identifier is reported only once for each function it appears in
../../../source/c/function.c:268:18: error: 'TRUE' undeclared (first use in this function)
        bResult = TRUE ;
                  ^~~~
../../../source/c/function.c:255:17: warning: unused variable 'iFromSize' [-Wunused-variable]
    ULONG iSize, iFromSize ;
                 ^~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLESCAPE':
../../../source/c/function.c:290:4: error: unknown type name 'ULONG'; did you mean 'HB_ULONG'?
    ULONG iSize, iFromSize ;
    ^~~~~
    HB_ULONG
../../../source/c/function.c:292:4: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
    BOOL bResult = FALSE ;
    ^~~~
    HB_BOOL
../../../source/c/function.c:292:19: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
    BOOL bResult = FALSE ;
                   ^~~~~
                   FILE
../../../source/c/function.c:307:21: error: 'TRUE' undeclared (first use in this function)
           bResult = TRUE ;
                     ^~~~
../../../source/c/function.c:290:17: warning: unused variable 'iFromSize' [-Wunused-variable]
    ULONG iSize, iFromSize ;
                 ^~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSEEK':
../../../source/c/function.c:328:18: warning: implicit declaration of function 'ISNUM'; did you mean 'IS_NUM'? [-Wimplicit-function-declaration]
    int uiStart = ISNUM( 4 ) ? ( unsigned int ) hb_parni( 4 ) - 1 : 0 ;
                  ^~~~~
                  IS_NUM
../../../source/c/function.c:333:4: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
    BOOL bSoft = hb_parl( 6 );
    ^~~~
    HB_BOOL
../../../source/c/function.c:336:15: warning: ordered comparison of pointer with integer zero [-Wextra]
    if (result > 0)
               ^
../../../source/c/function.c: In function 'HB_FUN_MYSQLSSLCONNECT':
../../../source/c/function.c:428:25: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
       HB_BOOL bResult = FALSE;
                         ^~~~~
                         FILE
../../../source/c/function.c: In function 'HB_FUN_MYSQLFETCHROW':
../../../source/c/function.c:572:4: error: unknown type name 'UINT'; did you mean 'LIST'?
    UINT ui, uiNumFields;
    ^~~~
    LIST
../../../source/c/function.c:573:4: error: unknown type name 'ULONG'; did you mean 'HB_ULONG'?
    ULONG *pulFieldLengths ;
    ^~~~~
    HB_ULONG
../../../source/c/function.c:583:20: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
    pulFieldLengths = mysql_fetch_lengths( mresult ) ;
                    ^
../../../source/c/function.c: In function 'HB_FUN_MYSQLLISTTBLS':
../../../source/c/function.c:636:14: error: 'LONG' undeclared (first use in this function)
       nr = ( LONG ) mysql_num_rows( mresult );
              ^~~~
../../../source/c/function.c:636:21: error: expected ';' before 'mysql_num_rows'

       nr = ( LONG ) mysql_num_rows( mresult );
                     ^~~~~~~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLLISTDBS':
../../../source/c/function.c:673:14: error: 'LONG' undeclared (first use in this function)
       nr = ( LONG ) mysql_num_rows( mresult );
              ^~~~
../../../source/c/function.c:673:21: error: expected ';' before 'mysql_num_rows'

       nr = ( LONG ) mysql_num_rows( mresult );
                     ^~~~~~~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLNUMROWS':
../../../source/c/function.c:697:17: error: 'LONGLONG' undeclared (first use in this function); did you mean 'HB_LONGLONG'?
    hb_retnll( ( LONGLONG )mysql_num_rows( ( ( MYSQL_RES * )hb_MYSQL_RES_par( 1 ) ) ) );
                 ^~~~~~~~
                 HB_LONGLONG
../../../source/c/function.c:697:27: error: expected ')' before 'mysql_num_rows'

    hb_retnll( ( LONGLONG )mysql_num_rows( ( ( MYSQL_RES * )hb_MYSQL_RES_par( 1 ) ) ) );
                           ^~~~~~~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLRESULTSTRUCTURE':
../../../source/c/function.c:796:3: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
   BOOL bCase = hb_parl( 2 );
   ^~~~
   HB_BOOL
../../../source/c/function.c:797:3: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
   BOOL bNoLogical = hb_param( 3, HB_IT_LOGICAL ) ? hb_parl( 3 ) : FALSE;
   ^~~~
   HB_BOOL
../../../source/c/function.c:797:67: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
   BOOL bNoLogical = hb_param( 3, HB_IT_LOGICAL ) ? hb_parl( 3 ) : FALSE;
                                                                   ^~~~~
                                                                   FILE
../../../source/c/function.c:824:37: warning: implicit declaration of function 'SQL2ClipType' [-Wimplicit-function-declaration]
         hb_arraySetC( itemField, 9, SQL2ClipType( ( long ) mfield->type, bNoLogical ) );
                                     ^~~~~~~~~~~~
--------------------------------------------------------------

How can I supplement the HBP file to generate the LIB correctly?


TIA
BR
GVARONAS

[SPA]
Estoy intentado usar MySQL con harbour usando la clase tDolphin (http://tdolphin.blogspot.com/).

He logrado crear la LIB (con setenvhg.bat), y algunos ejemplos (con setenvhg.bat y bldcon.bat), usando las herramientas de construcción (archivos BAT), que vienen con la clase.

Como siguiente paso, necesito incorporar la clase en un pequeño sistema que funciona en modo consola, el mismo que construyo con un archivo HBP usando la herramienta hbmk2.

Entonces, para estandarizar las herramientas que utilizo, ahora intento construir la LIB y los ejemplos usando la herramienta hbmk2.

Construyo un ejemplo (creado previamente con  setenvhg.bat y bldcon.bat ), ahora usando hbmk2, utilizando el siguiente comando:

D:\tdolphin\samples>c:\hb32\bin\hbmk2 listdbs.prg xhb.hbc -i..\include -LD:\tdolphin\lib\HARBOUR\MINGW32 -ldolphin -llibmysql -LD:\tdolphin\dll -rebuild -info 

y se crea el EXE y funciona sin ningún problema.

Ahora intento generar la LIB usando el siguiente archivo tdolphin.hbp que contiene lo siguiente:

=====================tdolphin.hbp START
-info  
-hblib 
-inc
-odolphin
-incpath=.\include
-llibmysql 
-LD:\tdolphin\dll 

-D__WIN__
-q0

xhb.hbc

.\source\prg\tdolpexp.prg
.\source\prg\tdolpqry.prg
.\source\prg\tdolpsrv.prg

.\source\c\function.c
.\source\c\gerrapi.c

.\source\lang\msgen.c
.\source\lang\msges.c

=====================tdolphin.hbp END

Esto es parte del Resultado del proceso:

--------------------------------------------------------------
D:\tdolphin>c:\hb32\bin\hbmk2 tdolphin.hbp -rebuild
hbmk2: Procesando: c:\hb32\contrib\xhb\xhb.hbc
hbmk2: Procesando: c:\hb32\contrib\hbct\hbct.hbc
hbmk2: Procesando: c:\hb32\contrib\hbtip\hbtip.hbc
hbmk2: Procesando: c:\hb32\contrib\hbfship\hbfship.hbc
hbmk2: Procesando: c:\hb32\contrib\hbxpp\hbxpp.hbc
hbmk2: Procesando: c:\hb32\contrib\hbwin\hbwin.hbc
hbmk2: Harbour: Compilando módulos...
hbmk2: Compilando...
In file included from ../../../source/c/function.c:61:0:
../../../include/mysql.h:63:19: error: unknown type name 'SOCKET'
 #define my_socket SOCKET
                   ^
../../../include/mysql_com.h:268:3: note: in expansion of macro 'my_socket'
   my_socket fd;     /* For Perl DBI/dbd */
   ^~~~~~~~~
../../../include/mysql.h:63:19: error: unknown type name 'SOCKET'
 #define my_socket SOCKET
                   ^
../../../include/mysql_com.h:437:16: note: in expansion of macro 'my_socket'
 int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
                ^~~~~~~~~
../../../source/c/function.c:77:40: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
 const char * SQL2ClipType( long lType, BOOL bLogical );
                                        ^~~~
                                        HB_BOOL
../../../source/c/function.c: In function 'HB_FUN_VAL2ESCAPE':
../../../source/c/function.c:255:4: error: unknown type name 'ULONG'; did you mean 'HB_ULONG'?
    ULONG iSize, iFromSize ;
    ^~~~~
    HB_ULONG
../../../source/c/function.c:257:4: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
    BOOL bResult = FALSE ;
    ^~~~
    HB_BOOL
../../../source/c/function.c:257:19: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
    BOOL bResult = FALSE ;
                   ^~~~~
                   FILE
../../../source/c/function.c:257:19: note: each undeclared identifier is reported only once for each function it appears in
../../../source/c/function.c:268:18: error: 'TRUE' undeclared (first use in this function)
        bResult = TRUE ;
                  ^~~~
../../../source/c/function.c:255:17: warning: unused variable 'iFromSize' [-Wunused-variable]
    ULONG iSize, iFromSize ;
                 ^~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLESCAPE':
../../../source/c/function.c:290:4: error: unknown type name 'ULONG'; did you mean 'HB_ULONG'?
    ULONG iSize, iFromSize ;
    ^~~~~
    HB_ULONG
../../../source/c/function.c:292:4: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
    BOOL bResult = FALSE ;
    ^~~~
    HB_BOOL
../../../source/c/function.c:292:19: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
    BOOL bResult = FALSE ;
                   ^~~~~
                   FILE
../../../source/c/function.c:307:21: error: 'TRUE' undeclared (first use in this function)
           bResult = TRUE ;
                     ^~~~
../../../source/c/function.c:290:17: warning: unused variable 'iFromSize' [-Wunused-variable]
    ULONG iSize, iFromSize ;
                 ^~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSEEK':
../../../source/c/function.c:328:18: warning: implicit declaration of function 'ISNUM'; did you mean 'IS_NUM'? [-Wimplicit-function-declaration]
    int uiStart = ISNUM( 4 ) ? ( unsigned int ) hb_parni( 4 ) - 1 : 0 ;
                  ^~~~~
                  IS_NUM
../../../source/c/function.c:333:4: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
    BOOL bSoft = hb_parl( 6 );
    ^~~~
    HB_BOOL
../../../source/c/function.c:336:15: warning: ordered comparison of pointer with integer zero [-Wextra]
    if (result > 0)
               ^
../../../source/c/function.c: In function 'HB_FUN_MYSQLSSLCONNECT':
../../../source/c/function.c:428:25: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
       HB_BOOL bResult = FALSE;
                         ^~~~~
                         FILE
../../../source/c/function.c: In function 'HB_FUN_MYSQLFETCHROW':
../../../source/c/function.c:572:4: error: unknown type name 'UINT'; did you mean 'LIST'?
    UINT ui, uiNumFields;
    ^~~~
    LIST
../../../source/c/function.c:573:4: error: unknown type name 'ULONG'; did you mean 'HB_ULONG'?
    ULONG *pulFieldLengths ;
    ^~~~~
    HB_ULONG
../../../source/c/function.c:583:20: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
    pulFieldLengths = mysql_fetch_lengths( mresult ) ;
                    ^
../../../source/c/function.c: In function 'HB_FUN_MYSQLLISTTBLS':
../../../source/c/function.c:636:14: error: 'LONG' undeclared (first use in this function)
       nr = ( LONG ) mysql_num_rows( mresult );
              ^~~~
../../../source/c/function.c:636:21: error: expected ';' before 'mysql_num_rows'

       nr = ( LONG ) mysql_num_rows( mresult );
                     ^~~~~~~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLLISTDBS':
../../../source/c/function.c:673:14: error: 'LONG' undeclared (first use in this function)
       nr = ( LONG ) mysql_num_rows( mresult );
              ^~~~
../../../source/c/function.c:673:21: error: expected ';' before 'mysql_num_rows'

       nr = ( LONG ) mysql_num_rows( mresult );
                     ^~~~~~~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLNUMROWS':
../../../source/c/function.c:697:17: error: 'LONGLONG' undeclared (first use in this function); did you mean 'HB_LONGLONG'?
    hb_retnll( ( LONGLONG )mysql_num_rows( ( ( MYSQL_RES * )hb_MYSQL_RES_par( 1 ) ) ) );
                 ^~~~~~~~
                 HB_LONGLONG
../../../source/c/function.c:697:27: error: expected ')' before 'mysql_num_rows'

    hb_retnll( ( LONGLONG )mysql_num_rows( ( ( MYSQL_RES * )hb_MYSQL_RES_par( 1 ) ) ) );
                           ^~~~~~~~~~~~~~
../../../source/c/function.c: In function 'HB_FUN_MYSQLRESULTSTRUCTURE':
../../../source/c/function.c:796:3: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
   BOOL bCase = hb_parl( 2 );
   ^~~~
   HB_BOOL
../../../source/c/function.c:797:3: error: unknown type name 'BOOL'; did you mean 'HB_BOOL'?
   BOOL bNoLogical = hb_param( 3, HB_IT_LOGICAL ) ? hb_parl( 3 ) : FALSE;
   ^~~~
   HB_BOOL
../../../source/c/function.c:797:67: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
   BOOL bNoLogical = hb_param( 3, HB_IT_LOGICAL ) ? hb_parl( 3 ) : FALSE;
                                                                   ^~~~~
                                                                   FILE
../../../source/c/function.c:824:37: warning: implicit declaration of function 'SQL2ClipType' [-Wimplicit-function-declaration]
         hb_arraySetC( itemField, 9, SQL2ClipType( ( long ) mfield->type, bNoLogical ) );
                                     ^~~~~~~~~~~~

--------------------------------------------------------------

¿Cómo puedo complementar el archivo HBP para generar la LIB correctamente?


TIA
BR
GVARONAS

Guillermo Varona Silupú

unread,
May 12, 2020, 11:04:33 PM5/12/20
to harbou...@googlegroups.com

Hi:

What library / tools are using for access to MySQL / MariaDB from harbour?

TIA

BR

GVARONAS

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/949a4d4b-ae79-43ea-93ac-ea74a64bd903%40googlegroups.com.

David Field

unread,
May 13, 2020, 11:38:57 AM5/13/20
to Harbour Users
Hello,

You can also check out access to any SQL engine with ADODB at https://groups.google.com/forum/#!forum/ado-harbour

Regards,
David Field

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Guillermo Varona Silupú

unread,
May 13, 2020, 12:02:53 PM5/13/20
to harbou...@googlegroups.com

Hi David:

Thank for your response.

I have seen and reviewed this option, it seems to me an excellent option, I will continue reviewing other options.

TVM

GVARONAS


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/ed4f6d77-19b9-4e61-9a78-c7b0f72d619f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages