Hello,
Is possible to use a Metter with this function?.
Thanks.
lucasdebeltran wrote:Thanks so much.
I assume you are referring to client server implementation of ADS
Please, can you look at AIS/ADS and xBrowse spped?.
// Harbour Advantage RDD sample
#include "FiveWin.ch"
#include "ads.ch"
#include "xbrowse.ch"
Request ADS,ADSKeyCount,ADSKeyNo,OrdKeyCount,OrdKeyNo, AdsGetRelKeyPos, AdsSetRelKeyPos
//----------------------------------------------------------------------------//
function Main()
local aArray := {}, cDbf, i
local nInicio, nFinal
local lCopy := .F.
// Driver CDX----------------------------------------------------------------
REQUEST DBFCDX, DBFFPT
RddRegister( "ADS", 1 )
RddSetDefault( "ADS" )
//setting up server type
// 1 = Local Server (no client / server)
// 2 = Remote Server
// 3 = Local + Remot
// 4 = Internet Server
// 5 = Local + Internet
// 6 = Remote+Internet
// 7 = Local + Remote + Internet , best choice
adsSetServerType( 4 ) // ó adsSetServerType( ADS_REMOTE_SERVER )
//setting up the file types
// 1 = DBFNTX
// 2 = DBFCDX
// 3 = ADSADI
adsSetFileType( ADS_CDX ) // o ADS_CDX
AdsRightsCheck(.F.)
IF AdsConnect60( "\\189.228.227.218:2000\cursos\adsdemo\cibconwn\stc\internet.add", 4,"demo","demo")
MsgInfo("Esta ahora conectado al Sevidor AIS de . en Mexico "+CRLF+CRLF+;
"You are now connected to AIS Server","Bienvenido / Welcome / Versión "+ADSVersion())
ELSE
MsgStop("Se ha rechazado la conexión al servidor AIS, por favor intente mas tarde"+CRLF+CRLF+;
"Conection to AIS Server rejected, please, try again later","AIS Error")
QUIT
ENDIF
USE CATCUE SHARED NEW ALIAS "DATOS"
DATOS->(AdsCacheRecords(50))
DATOS->(OrdSetFocus("NUMCUENTA"))
DATOS->(DBGOTOP())
sysrefresh()
nInicio := seconds()
COPY TO "TEMPORAL.DBF" VIA "DBFCDX"
nfinal := seconds()
msgalert(nFinal-nInicio, " TIME CopyTable ")
USE TEMPORAL NEW
XBROWSE()
dbcloseall()
quit
return nil
//----------------------------------------------------------------------------//
function Test_SQL()
LOCAL cSql := ""
LOCAL aArray := {}
LOCAL cAlias := Alias()
/*al inicio de la instruccion sql se define un area vacia*/
DBSelectArea(0)
/*se define instruccion sql en una cadena de texto*/
cSql := "SELECT * FROM CUSTOMER"
msgINFO(csql, "cSql")
/*crea instruccion sql y pasa los datos a tabla temporal*/
ADSCreateSQLStatement( "REPTMP", 2 )
IF ADSExecuteSQLDirect( cSql )
DBSelectArea("REPTMP")
REPTMP->( DBGoTop() )
IF LastRec() > 0 // !REPTMP->( Eof() )
/*lista resultado en tabla*/
xbrowse()
//aArray := FW_DbfToArray()
//XBROWSER aArray
ELSE
/*no se encontro datos que cumpla condicion sql*/
MsgInfo( "No se ha encontrado REGISTROS" )
ENDIF
/*cierra tabla de datos temporal*/
REPTMP->( DBCloseArea() )
ELSE
Alert( "AdsExecuteSQLDirect() failed with error "+ Str( ADSGetLastError() ) )
ENDIF
/*se selecciona area de datos anterior*/
IF !Empty(cAlias)
DBSelectArea(cAlias)
ENDIF
/*da foco al browse*/
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 66 guests