What is the solution for Harbour Sql?

Post Reply
User avatar
MFarias
Posts: 39
Joined: Wed Jun 25, 2014 11:16 am
Location: João Pessoa,PB - Brazil

What is the solution for Harbour Sql?

Post 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? :?: :)
FW 17.09 - xHB 1.2.3 - Embarcadero C++ 7
xDevStudio 0.72 - FivEdit ( \o/ ) - Pelles C
MySQL 5.7 - DBF
FastReport - PHP for Web Services - Java Android
http://matheusfariasdev.wordpress.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: What is the solution for Harbour Sql?

Post 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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
MFarias
Posts: 39
Joined: Wed Jun 25, 2014 11:16 am
Location: João Pessoa,PB - Brazil

Re: What is the solution for Harbour Sql?

Post 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

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
FW 17.09 - xHB 1.2.3 - Embarcadero C++ 7
xDevStudio 0.72 - FivEdit ( \o/ ) - Pelles C
MySQL 5.7 - DBF
FastReport - PHP for Web Services - Java Android
http://matheusfariasdev.wordpress.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: What is the solution for Harbour Sql?

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: What is the solution for Harbour Sql?

Post 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
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: What is the solution for Harbour Sql?

Post 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.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
Armando
Posts: 2479
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

Re: What is the solution for Harbour Sql?

Post 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
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: What is the solution for Harbour Sql?

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
MFarias
Posts: 39
Joined: Wed Jun 25, 2014 11:16 am
Location: João Pessoa,PB - Brazil

Re: What is the solution for Harbour Sql?

Post 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:
FW 17.09 - xHB 1.2.3 - Embarcadero C++ 7
xDevStudio 0.72 - FivEdit ( \o/ ) - Pelles C
MySQL 5.7 - DBF
FastReport - PHP for Web Services - Java Android
http://matheusfariasdev.wordpress.com
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: What is the solution for Harbour Sql?

Post 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.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: What is the solution for Harbour Sql?

Post 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,
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: What is the solution for Harbour Sql?

Post 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
Post Reply