Porting FW to FWH using MySql

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Porting FW to FWH using MySql

Post by Antonio Linares »

Wzaf,

What FWH version are you using ? Harbour or xHarbour, what version ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Porting FW to FWH using MySql

Post by nageswaragunupudi »

In case of MySql we are compelled to use ODBC driver. There is no free OLEDB provider available. The total functionality of ADO is not supported by ODBC. We need to work with these limitations while working with MySql. We can not expect whatever that works with Oracle, MSSql etc. will also work with MySql ODBC driver.
Regards

G. N. Rao.
Hyderabad, India
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

Antonio,

I use FWH 10.1
Harbour for BCC - 2.0

Regards
Wzaf
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: Porting FW to FWH using MySql

Post by Daniel Garcia-Gil »

Hello wzaf.


Try this way

Code: Select all


#include "Fivewin.ch" 
#include "ado.ch"

FUNCTION MAIN() 
local oCon, lOk
 
lOk:=.t.
 
 if lOk
    TRY
       oCon:=TOleAuto():new("ADODB.Connection")
      
       
    CATCH oErroraDo
       ErrorCatch( oErrorAdo, "Error en OLE" )
    END
     
     
    TRY       
       oCon:connectionString := "Driver={MySQL ODBC 5.1 Driver};Server=EQUIPO;Port=3306;Database=test;User=root; Password=12345678;Option=3;"
       oCon:open()
    CATCH oErrorAdo

       ErrorCatch( oErrorAdo,"Error en OPEN"  )
       return .f.
    END
    
 endif
return nil

Function ErrorCatch( oError, cTitle )

   LOCAL cMensagemRetorno := ""
   local cArg, cArgs := ""

   if ValType( oError:Args ) == "A"
      for each cArg in oError:Args
         cArgs += cValToChar( cArg ) + CRLF
      NEXT
   endif
   cMensagemRetorno := "[Subsystem]"         + oError:SubSystem                 + CRLF +;
                       "[SubCode]"           + alltrim( str( oError:SubCode ) ) + CRLF +;
                       "[Operacion]"         + oError:Operation                 + CRLF +;
                       "[Descripcion]"       + oError:Description               + CRLF +;
                       "[Argumentos]"        + cArgs

RETURN( msgStop( cMensagemRetorno, cTitle ) )
 
 
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

Tank you Daniel ! ,
it works .


Best Regards
Wzaf
Post Reply