What is the solution for Harbour Sql?
Posted: Tue Jul 01, 2014 4:08 pm
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?
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
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
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.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,Antonio Linares wrote:
Regarding ADO performance with remote database engines, I let other users comment about their experiences. I have just used ADO locally.
I also need advice. Which mysql version should i download. MySQL Server??. or something else?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?
Just a database engine that is not local, ie. accessible only through a network by an IP address.dutch wrote:What does it mean "remote database engines" ?