Page 1 of 1

What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 4:08 pm
by MFarias
I see on the internet some tools for FiveWin with Harbour and am using Sql with some questions, wanted to know what you guys have used for this? :?: :)

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 4:20 pm
by Antonio Linares
Matheus,

ADO is a great choice. There are many examples in these forums and also FWH provides great functions to manage it :-)

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 5:02 pm
by MFarias
Antonio,
I already have seen some example of ADO in FiveWin and even use this function in some reports that I took the sources and adapted to my use:
I can deal with it better as I want the returns and evaluate the performace based on the mass amount of data it is used.
but then I ask you, regarding the performace or layers created for access, it would be possible, I wish to use with remote servers and the like, would be viable? (Ie with Mysql or MsSql for example)
Code: Select all  Expand view

Function SqlQuery( cSql, lRecordSet,lExecute, lCompact )

   && exemplo -> aresp:=SqlQuery([SELECT CODIPRO FROM PRODUTOS WHERE NOMEPRO LIKE '%B%'])

   local uRet    := {} // Retorno com Registros
   local oRs, nAt , oCn // Objetos de controle para o ODBC e o Registro
   Local cArquivo  := &(Alias())->( DbInfo( DBI_FULLPATH ) )
    Local cDiretorio:= iif ( Empty( cFilePath(cArquivo)) , Curdrive()+':'+curdir()+'\',cFilePath(cArquivo) )

   DEFAULT lCompact  := .t.
   DEFAULT lRecordSet  := .f.

   cSql     := Upper( alltrim(cSql) )

   oCn := FW_OpenAdoConnection( [Provider=Microsoft.Jet.OLEDB.4.0;Data Source=]+cDiretorio+[ ;Extended Properties=dBASE IV;User ID=Admin;Password=] ,.t.)
   DEFAULT lExecute  := !( LEFT( cSql, 7 ) == '
SELECT ' )
    if oCn != nil
       if lExecute
          TRY
             uRet := oCn:Execute( cSql )
          CATCH
          END
          return uRet
       else
           oRs      := FW_OpenRecordSet( oCn, cSql )
            if lRecordSet
               uRet := oRs
            else
               if oRs != nil
                  if oRs:RecordCount() > 0
                     uRet := oRs:GetRows()
                     oRs:MoveFirst()
                  endif
                  oRs:Close()
                  if lCompact
                     if Len( uRet ) == 1
                        uRet  := uRet[ 1 ]
                        if Len( uRet ) == 1
                           uRet  := uRet[ 1 ]
                        endif
                     endif
                  endif
               endif
        endif
       endif
    endif
   return uRet

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 5:09 pm
by Antonio Linares
Matheus,

If you are going to use MySQL and not other database engine, then you can use Daniel's TDolphin and this way ADO is not required.

Regarding ADO performance with remote database engines, I let other users comment about their experiences. I have just used ADO locally.

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 5:39 pm
by Enrico Maria Giordano
Antonio,

Antonio Linares wrote:Regarding ADO performance with remote database engines, I let other users comment about their experiences. I have just used ADO locally.


ADO performance is very good with remote database engines. I used it in many web projects and in one xHarbour/FWH project and had no complains from the customers.

EMG

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 5:44 pm
by Marc Vanzegbroeck
Antonio Linares wrote:
Regarding ADO performance with remote database engines, I let other users comment about their experiences. I have just used ADO locally.


Antonio,

Als my customers are very happy after I changed from DBF to ADO.
It's faster and more solid. I didn't have any corrupted databases anymore. Especially on networks.

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 6:43 pm
by Armando
Friends:

My five cents, as all of you said, I have an App since 2007 with MySql and ADO, and not
problems at all.

I advise you, ADO + MySql + FW, and nothing else

Regards

Re: What is the solution for Harbour Sql?

PostPosted: Tue Jul 01, 2014 11:07 pm
by nageswaragunupudi
I used ADO for many years with Oracle, MSSql, MySql (recently) on remote and local. This is the best option.

When we deal with huge tables, we need to change our habits to open full tables like in xBase. We should learn to fall in line with the rest of the world to limit reading only to the required part of the table.

Re: What is the solution for Harbour Sql?

PostPosted: Wed Jul 02, 2014 2:36 pm
by MFarias
Well folks,
I installed the drive in my machine mysql to use with ado, someone would have some basic examples of connection and processing of such data to provide? :wink:

Re: What is the solution for Harbour Sql?

PostPosted: Wed Jul 02, 2014 4:50 pm
by Horizon
MFarias wrote:Well folks,
I installed the drive in my machine mysql to use with ado, someone would have some basic examples of connection and processing of such data to provide? :wink:


I also need advice. Which mysql version should i download. MySQL Server??. or something else?

Thanks.

Re: What is the solution for Harbour Sql?

PostPosted: Fri Jul 04, 2014 1:14 am
by dutch
Dear All,

I'm trying to move to SQL via ADO now.

What does it mean "remote database engines" ?
Is it the same as program access via internet IP to database server directly? or
Is the program access database on Web Hosting via IP or URL?

What is the different?

Regards,

Re: What is the solution for Harbour Sql?

PostPosted: Fri Jul 04, 2014 8:03 am
by Enrico Maria Giordano
Dutch,

dutch wrote:What does it mean "remote database engines" ?


Just a database engine that is not local, ie. accessible only through a network by an IP address.

EMG