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
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 Linares wrote:
Regarding ADO performance with remote database engines, I let other users comment about their experiences. I have just used ADO locally.
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?
dutch wrote:What does it mean "remote database engines" ?
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 34 guests