topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
ADS - recno() con query SQL SOLUCIONADO
|
Rolando,
que te puedo decir, el siguiente ejemplo funciona, incluso arme un diccionario, lo probe con ADS 7.1 que es con el que trabajo aqui
[code=fw:3ee4mk3j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ads.ch"</span><br /><br /><span style="color: #B900B9;">//#pragma /b+</span><br /><br /><span style="color: #00C800;">FUNCTION</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cAlias := <span style="color: #ff0000;">"sql"</span>, cRec := <span style="color: #ff0000;">""</span><br /><br /> rddRegister<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADS"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> rddsetdefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADS"</span> <span style="color: #000000;">)</span><br /><br /> AdsSetFileType<span style="color: #000000;">(</span> ADS_CDX <span style="color: #000000;">)</span><br /> <br /> SET <span style="color: #00C800;">SERVER</span> REMOTE<br /><br /> adsConnect60<span style="color: #000000;">(</span> <span style="color: #ff0000;">"//192.168.1.20:3000/ADS/test.add"</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"ADSSYS"</span>,<span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /> adsRightsCheck<span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br /> <br /> <span style="color: #B900B9;">//ADSSETDATEFORMAT("DD/MM/YYYY")</span><br /><br /> <span style="color: #0000ff;">SELECT</span> <span style="color: #000000;">0</span><br /> ADSCreateSQLStatement<span style="color: #000000;">(</span> cAlias, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> ADSPREPARESQL<span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from customer where state = 'NY'"</span> <span style="color: #000000;">)</span><br /> ADSEXECUTESQL<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> ? <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span> -> <span style="color: #000000;">(</span> lastrec<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span> -> <span style="color: #000000;">(</span> DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> ! <span style="color: #000000;">(</span>cALias<span style="color: #000000;">)</span> -> <span style="color: #000000;">(</span> EOF<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cRec += STR<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>RECNO<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span> -> <span style="color: #000000;">(</span> DBSKIP<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">ENDDO</span><br /><br /> ? cRec<br /><br /> BROWSE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> DBCLOSEALL<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3ee4mk3j]
|
ADS - recno() con query SQL SOLUCIONADO
|
MArcelo,
Efectivamente tu código funciona en modo server. Creo que dscubrí el motivo que a mi me falla esto d obtener los recno().
Si el query lo hago como vos funciona bién, ( = 'NY').
Prueba a cambiar la línea
[code=fw:2n5k9hhs]<div class="fw" id="{CB}" style="font-family: monospace;">ADSPREPARESQL<span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from customer where state = 'NY'"</span> <span style="color: #000000;">)</span></div>[/code:2n5k9hhs]
con
[code=fw:2n5k9hhs]<div class="fw" id="{CB}" style="font-family: monospace;">ADSPREPARESQL<span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from customer where state like '%NY%' "</span> <span style="color: #000000;">)</span></div>[/code:2n5k9hhs]
Ahí verás que no se obtiene el recno(). Es esto raro porque buscar con "like" lo hace perfectamente pero no retorna los recno() originales, sino como comente al iniciar este post.
Gracias.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
ADS - recno() con query SQL SOLUCIONADO
|
Marcelo,
Encontré la solución. Gracias a tu ayuda y el link al foro que me recomendaste leer.
Además estuve leyendo el help del ADS y ahí se indica que cuando se use "LIKE", el query devolverá un cursor tipo STATIC.
Lo que hice fue cambiar el query:
[code=fw:2453kkom]<div class="fw" id="{CB}" style="font-family: monospace;">ADSPREPARESQL<span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from customer where state like '%NY%' "</span> <span style="color: #000000;">)</span></div>[/code:2453kkom]
Por:
[code=fw:2453kkom]<div class="fw" id="{CB}" style="font-family: monospace;">ADSPREPARESQL<span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from customer where CONTAINS( state, '%NY%' ) "</span> <span style="color: #000000;">)</span></div>[/code:2453kkom]
Estuve leyendo, también en el help, que la función "CONTAINS" se puede usar también en el query, así que en lugar de aplicar un filtro AOF, lo uso así (que en forma indirecta aplica un filtro, pero en el query es más rápido)
Saludos
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
ADS -> AdsGetFieldType y AdsGetMemoDataType
|
Hola,
Alguien tiene codificadas las funciones AdsGetMemoDataType() y/o AdsGetFieldType() ?. No consigo afinarlas <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
AdsGetFieldType()
[code:38xrvykf]Syntax
UNSIGNED32 AdsGetFieldType (ADSHANDLE hTable, UNSIGNED8 *pucFldName, UNSIGNED16 *pusType);
Parameters
hTable (I) Handle of table or cursor.
pucFldName (I) Name of field.
pusType (O) Retrieves the type of the field (ADS_LOGICAL, ADS_NUMERIC, ADS_DATE, ADS_STRING, ADS_CISTRING, ADS_MEMO, ADS_VARCHAR, ADS_COMPACTDATE, ADS_DOUBLE, ADS_INTEGER, ADS_IMAGE, ADS_BINARY; ADS_SHORTINT; ADS_TIME; ADS_TIMESTAMP; ADS_AUTOINC; ADS_RAW; ADS_CURDOUBLE, ADS_MONEY)[/code:38xrvykf]
AdsGetMemoDataType()
[code:38xrvykf]Syntax
UNSIGNED32 AdsGetMemoDataType (ADSHANDLE hTable, UNSIGNED8 *pucFldName, UNSIGNED16 *pusType);
Parameters
hTable (I) Handle of table or cursor.
pucFldName (I) Name of the field to check memo type.
pusType (I) Buffer in which to return the type of memo. This will be one of the following: ADS_MEMO, ADS_BINARY, or ADS_IMAGE.[/code:38xrvykf]
Gracias por el cable.
|
ADS -> AdsRegCallBack()
|
Hola,
Alguien usa con exito esta funcion ( ADSRegCallBack() )?
Saludos.
C.
|
ADS -> AdsRegCallBack()
|
Haz probado asi ???:
FUNCTION Main()
...
AdsRegCallBack( {|nPercent| outputstuff(nPercent)} )
INDEX ON First+LAST+LABEL1+LABEL2 TAG First
AdsClrCallBack()
RETURN nil
FUNCTION outputstuff(nPercent) /* funcion "callback" */
? "Porcentaje de avance:", nPercent
RETURN inkey() == 27
|
ADS -> AdsRegCallBack()
|
Hi Rene,
Tenia una construccion similar a la tuya y no me funcionaba y llevaba 3 dias con ello, pero... te explico. Yo queria usar esta funcionalidad con la funcion ADSCopyTableContents(). La funcion en si va como un torpedo y segun su help:
[quote:267fhw1s]
Note This function is capable of utilizing registered callback functions
[/quote:267fhw1s]
Y un codigo sencillo a probar podria ser
[code:267fhw1s]
FUNCTION Main()
...
USE ORIGEN SHARED NEW
cAliasOrigen := Alias()
USE DESTINO SHARED NEW
cAliasDestino := Alias()
AdsRegCallBack( {|nPercent| outputstuff(nPercent)} )
(cAliasOrigen)->( AdsCopyTableContents( cAliasDestino ) )
AdsClrCallBack()
RETURN nil
[/code:267fhw1s]
Y venga a probar q probar y nada. En cambio lo pruebas en un ejemplo con indexados y funciona Ok. En fin, desisto ya perder mas tiempo. Sera un error del Help de ADS.
Bueno, gracias por tu feedback.
Nota: Nos tomamos prontito unas cervezas en Barcelona ? <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Un abrazo
|
ADS -> AdsRegCallBack()
|
Carles:
Nop, no es un error del Help ADS, es simplemente que el "Callback" solo esta implementado para los índices en el RDDADS, no fuciona en ninguna otra función.... <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Voy a ponerme en contacto con Bryan Hayes, a ver si es posible implementar llamadas callback en toras funciones.
|
ADS -> AdsRegCallBack()
|
Rene;
¿Hay noticias sobre este tema? ¿Te ha respondido Brian?
Mi intención es usarla en algo asi:
[code:1pkhxl2y]
AdsRegCallBack( { | nPercent | ProgressUpdate( nPercent ) } )
IF ADSExecuteSQLDirect( cCons )
...
[/code:1pkhxl2y]
Pero observo que durante la ejecución del ADSExecuteSQLDirect la función registrada con AdsRegCallBack no es invocada. Quisiera conocer que hacer para lograr mostrar el progreso de una ejecución SQL.
Reinaldo.
|
ADS -> AdsRegCallBack()
|
Hi Reinaldo.
Have you solved this issue ?
I have the same problem. I want to execute a function when Advantage is making a select (is only a meter for showing that the procedure is working ).
Thanks a lot.
Massimo.
|
ADS -> AdsRegCallBack()
|
It is working right now for me.
Here is the code snippet:
[code=fw:3lek6r7q]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">IF</span> ADSCreateSQLStatement<span style="color: #000000;">(</span> ::<span style="color: #000000;">cAlias</span>, ::<span style="color: #000000;">nTblType</span>, ::<span style="color: #000000;">hAds</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//.or. !ADSVerifySQL( cScript )</span><br /><br /> oMeter := PROGRESSBAR<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">100</span>, ::<span style="color: #000000;">cProgressMsg</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oMeter:<span style="color: #000000;">oDlg</span> <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oMeter:<span style="color: #000000;">oDlg</span>:<span style="color: #0000ff;">center</span><span style="color: #000000;">(</span> WndMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">bProgress</span> := <span style="color: #000000;">{</span> |n| oMeter:<span style="color: #000000;">nCount</span>++, oMeter:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> Register_CallBack<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> | nPercent | EVAL<span style="color: #000000;">(</span> ::<span style="color: #000000;">bProgress</span>, nPercent <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">TRY</span> <br /> isgood := ADSExecuteSQLDirect<span style="color: #000000;">(</span> cSql <span style="color: #000000;">)</span><br /> CATCH<br /> isgood := .F.<br /> END<br /><br /> Unregister_callback<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />...<br /> </div>[/code:3lek6r7q]
[code=fw:3lek6r7q]<div class="fw" id="{CB}" style="font-family: monospace;"><br />*-------------------------------------------------------------------------------------------------------<br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ace.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbvm.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapiitm.h"</span><br /><br />UNSIGNED32 long _stdcall ShowPercentage<span style="color: #000000;">(</span> UNSIGNED16 usPercentDone , UNSIGNED32 ulCallbackID <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">static</span> PHB_ITEM pBlock;<br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> REGISTER_CALLBACK <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> pBlock = hb_itemParam<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> hb_retni<span style="color: #000000;">(</span> AdsRegisterCallbackFunction<span style="color: #000000;">(</span> ShowPercentage , <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> UNREGISTER_CALLBACK <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> AdsClearCallbackFunction<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> pBlock <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hb_itemRelease<span style="color: #000000;">(</span> pBlock <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br />UNSIGNED32 long _stdcall ShowPercentage<span style="color: #000000;">(</span> UNSIGNED16 usPercentDone, UNSIGNED32 ulCallbackID <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//UNSIGNED32 WINAPI ShowPercentage( UNSIGNED16 usPercentDone, UNSIGNED32 ulCallbackID )</span><br /><span style="color: #000000;">{</span><br /> PHB_ITEM pPercent = hb_itemPutNI<span style="color: #000000;">(</span> <span style="color: #00C800;">NULL</span>, usPercentDone <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> pPercent && pBlock<span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hb_vmEvalBlockV<span style="color: #000000;">(</span> pBlock, <span style="color: #000000;">1</span>, pPercent <span style="color: #000000;">)</span>;<br /> hb_itemRelease<span style="color: #000000;">(</span> pPercent <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /><span style="color: #000000;">}</span><br /><br /> </div>[/code:3lek6r7q]
Hope that helps,
Reinaldo.
|
ADS -> AdsRegCallBack()
|
Thanks Reinaldo.
I'll give it a try. But not now. I have to turn off the computer because there's a storm coming and I would not take chances with electrical surges.
Massimo.
|
ADS -> AdsRegCallBack()
|
Hi Reinaldo.
I made this function, appending yours, but I receive some errors during compiling process. I'm using Xharbour commercial.
I'm doing something wrong ?
Thanks a lot.
Massimo
[color=#0000FF:1ers2g6f]**************************************************************************
#include "fivewin.ch"
#include "c:\xHb\include\ads.ch"
Function Girbase()
local oDlg, ometer
DEFINE DIALOG oDlg RESOURCE "UTF_TEST"
oMeter = Tprogress():Redefine(100,oDlg)
REDEFINE BUTTON ID 300 of oDlg ACTION (oDlg:End())
REDEFINE BUTTON ID 301 of oDlg ACTION (leggi_dati(@ometer))
ACTIVATE DIALOG oDlg CENTERED
dbcloseall()
return nil
**********************************
STATIC FUNCTION leggi_dati(ometer)
LOCAL stringa_sql
oMeter:SetRange( 1, 100 )
stringa_sql = "SELECT * from bollette order by utente"
Select 0
ADSCReateSqlStatement("Utenza", 1)
Register_CallBack( { | nPercent | agg_meter(@ometer, nPercent) } )
ADSExecuteSQLDirect(stringa_sql)
Unregister_callback()
browse()
return nil
*******************************************
STATIC FUNCTION agg_meter(ometer, npercent)
oMeter:Nposition = npercent
sysrefresh()
return nil
*-------------------------------------------------------------------------------------------------------
#pragma BEGINDUMP
#include <windows.h>
#include "ace.h"
#include "hbapi.h"
#include "hbvm.h"
#include "hbapiitm.h"
UNSIGNED32 long _stdcall ShowPercentage( UNSIGNED16 usPercentDone , UNSIGNED32 ulCallbackID );
static PHB_ITEM pBlock;
//---------------------------------------------------------------------------//
HB_FUNC( REGISTER_CALLBACK )
{
pBlock = hb_itemParam( 1 );
hb_retni( AdsRegisterCallbackFunction( ShowPercentage , 1 ) );
}
//---------------------------------------------------------------------------//
HB_FUNC( UNREGISTER_CALLBACK )
{
AdsClearCallbackFunction();
if( pBlock )
{
hb_itemRelease( pBlock );
}
}
//---------------------------------------------------------------------------//
UNSIGNED32 long _stdcall ShowPercentage( UNSIGNED16 usPercentDone, UNSIGNED32 ulCallbackID )
// UNSIGNED32 WINAPI ShowPercentage( UNSIGNED16 usPercentDone, UNSIGNED32 ulCallbackID )
{
PHB_ITEM pPercent = hb_itemPutNI( NULL, usPercentDone );
if( pPercent && pBlock)
{
hb_vmEvalBlockV( pBlock, 1, pPercent );
hb_itemRelease( pPercent );
}
return 0;
}[/color:1ers2g6f]
[color=#BF0000:1ers2g6f]Type: C >>>xhb.exe -o"obj\GIRBASE.c" -m -n -q -gc0 -I"c:\fwh\include" -I"C:\xHB\include" -I"C:\xHB\include\w32" "c:\fw\BLU\GAS\GIRBASE.PRG"<<<
xHarbour Compiler build 1.0.0 (SimpLex)
Copyright 1999-2007, <!-- m --><a class="postlink" href="http://www.xharbour.org">http://www.xharbour.org</a><!-- m --> <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Generating object output to 'obj\GIRBASE.obj'...
c:\\fw\\BLU\\GAS\\GIRBASE.PRG(59): error: Invalid type specification.
c:\\fw\\BLU\\GAS\\GIRBASE.PRG(67): warning: Operands of = have illegal types 'unsigned long __stdcall function(unsigned short, unsigned long)' and 'long int __stdcall function(unsigned short, unsigned long)'.
c:\\fw\\BLU\\GAS\\GIRBASE.PRG(82): error: Invalid type specification.
Type: C >>>Couldn't build: GIRBASE.obj<<<
Type: C >>>TMAKEOBJECT<<<
Type: C >>>TMAKEOBJECT:REFRESH<<<
Type: N >>> 1322<<<
[/color:1ers2g6f]
|
ADS -> AdsRegCallBack()
|
Massimo;
I have compiled the c code with all versions of bcc. I do get one warning that can be ignored. I'm sorry I can't say why you get errors. The code is quite simple. I'm too busy these days. I'll try to come back to this subject next week if you still need help.
Best regards,
Reinaldo.
|
ADS -> AdsRegCallBack()
|
Reinaldo,
I got warning: Parameter 'ulCallbackID' is never used in function ShowPercentage
It doesn't affect the application on run-time but annoying when compiling.. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
ADS -> AdsRegCallBack()
|
Hey Frances;
I confirm you are right. I would try not to worry as the code works perfectly. I will look into it soon to see if that waring can be, somehow, pacified.
Best regards,
Reinaldo.
|
ADS -> AdsRegCallBack()
|
[quote="reinaldocrespo":11gtqr08]Hey Frances;
I confirm you are right. I would try not to worry as the code works perfectly. I will look into it soon to see if that waring can be, somehow, pacified.
Best regards,
Reinaldo.[/quote:11gtqr08]
Reinaldo,
I did this. it solves the warning.
[code=fw:11gtqr08]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> UNSIGNED32 long _stdcall ShowPercentage<span style="color: #000000;">(</span> UNSIGNED16 usPercentDone, UNSIGNED32 ulCallbackID <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> PHB_ITEM pPercent = hb_itemPutNI<span style="color: #000000;">(</span> <span style="color: #00C800;">NULL</span>, usPercentDone <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> pPercent && pBlock<span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hb_vmEvalBlockV<span style="color: #000000;">(</span> pBlock, ulCallbackID <span style="color: #B900B9;">/*1*/</span>, pPercent <span style="color: #000000;">)</span>;<br /> hb_itemRelease<span style="color: #000000;">(</span> pPercent <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /> <span style="color: #000000;">}</span><br /> </div>[/code:11gtqr08]
|
ADS -> AdsRegCallBack()
|
Frances;
Nice job. I'll use your implementation.
Thank you.
Reinaldo.
|
ADS -> Optimizacion de consultas SQL
|
Hola,
El siguiente codigo es ejecutado con FWH y funciona perfecto, pero si ejecuto una query con ARC32 ( Tools->Native SQL) el resultado es muchiiisimo mas rapido. Mi Pregunta es: Se puede optimizar la ejecucion de las funciones de SQL en ADS ?
[code:3try73pm]
#include "ads.ch"
#include "fivewin.ch"
*--------------
FUNCTION main()
*--------------
LOCAL cServer := "\\BSD001\Test"
LOCAL consulta := "Select * from Test where age > 90"
LOCAL cTxt := ''
RddRegister("ADS",1)
RddSetDefault("ADS")
AdsSetServerType ( 2 )
SET FILETYPE TO CDX
AdsConnect( cServer , 2 )
IF ! ADSCreateSQLStatement("SQLarea",2) // 2 == ADS_CDX
MsgAlert( "ADSCreateSQLStatement('SQLarea',2)" )
RETU .F.
ENDIF
IF ADSExecuteSQLDirect( consulta )
FOR nI := 1 TO 20
cTxt += sqlarea->first + ' ' + sqlarea->last + ' ' + sqlarea->street + ' ' + str( sqlarea->age ) + CRLF
sqlarea->( DbSkip() )
NEXT
msgInfo( cTxt )
ENDIF
AdsDisconnect(AdsGetConnectionHandle())
sqlarea -> ( DBCLOSEAREA() )
RETU NIL
[/code:3try73pm]
Muchas gracias
Carlos.
|
ADS -> Optimizacion de consultas SQL
|
El server que tu indicas en una carpeta de tablas DBF ?
|
ADS -> Optimizacion de consultas SQL
|
Hola,
No entiendo tu pregunta. Se pretende trabajar contra servidor, no en modo local.
Saludos.
C.
|
ADS -> Optimizacion de consultas SQL
|
no importa que sea un server ADS, la pregunta es si las tablas son archivos DBF o si es un server SQL, por ejemplo Microsoft SQL Server.
Eso.
|
ADS -> Optimizacion de consultas SQL
|
[quote="dbzap":3rgk4mf8]no importa que sea un server ADS, la pregunta es si las tablas son archivos DBF o si es un server SQL, por ejemplo Microsoft SQL Server.
Eso.[/quote:3rgk4mf8]
Si es Advantage, son base de datos DBF, advantage te da la ventaja SQL.
|
ADS -> Optimizacion de consultas SQL
|
Hola,
No me explicado bien. Voy a intentarlo de nuevo <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Quiero saber si contra un server ADS, y usando las funciones propias de ADS, como ADSExecuteSqlDirect(), se puede alcanzar la velocidad de ejecucion del ACE32 cuando se realizan las querys.
A modo de ejemplo, el test de arriba se me ejecuta en aproximadamente 6 segundos con la base test.dbf y 100000 registros, mientras que con Ace32 esta 0.7 seg. Partiendo de la base, que Ace32 no utiliza ni ODBC ni otros componentes de acceso a datos, (q yo sepa), me gustaria saber la diferencia.
No lo he probado via ODBC, pero la idea es usar solo las funciones ACE.
Gracias por vuestro soporte.
|
ADS -> Optimizacion de consultas SQL
|
Hola,
probaste con utilizar otro formato para el resultado
ADSCreateSQLStatement("SQLarea",n) 1,2,3
seria interesante ver como cambia esto, por otra parte el tiempo que das, lo 6 segundos es tomando en cuenta el tiempo de conexion previa a la consulta o solo la consulta
saludos
Marcelo
|
ADS -> Optimizacion de consultas SQL
|
Hola Marcelo,
1.- El 2º parametro es el tipo de tabla, siendo 2 == DBF_CDX (eso creo, ahora me haces dudar)
2.- El tiempo aprox. lo calculo sencillamente
[code:2iwmvvhi]nInicio := Seconds()
ADSExecuteSQLDirect( consulta )
MsgInfo( Seconds() - nInicio )
[/code:2iwmvvhi]
No se si la gente esta usando esta funcion contra servidor que va de maravilla, pero es q jode ver como en el ARC32 vuela, al lado de la tuya. Pensaba que ARC32 usaba las mismas funciones del ACE.
Gracias por tu ayuda.
|
ADS -> Optimizacion de consultas SQL
|
[quote="Carles":2t8yj4vd]Hola Marcelo,
1.- El 2º parametro es el tipo de tabla, siendo 2 == DBF_CDX (eso creo, ahora me haces dudar)
[/quote:2t8yj4vd]
Era para saber si afectava en que formato recibes el resultado, pueda que alli esta algo de la respuesta
[quote:2t8yj4vd]
No se si la gente esta usando esta funcion contra servidor que va de maravilla, pero es q jode ver como en el ARC32 vuela, al lado de la tuya. Pensaba que ARC32 usaba las mismas funciones del ACE.
[/quote:2t8yj4vd]
Yo, utilizo SQL de manera nativa con ADS, es realmente comodo y muy potente.
Haber que resultados sacas de tu investigacion, por otra parte estaria analizar el codigo fuente de ARC y/o hacer un peque~no ejemplo con Delphi que haga la misma consulta para ver si se optiene o no la misma velocidad del ARC, si es asi, significaria que el problema esta en la implementacion del API de ADS en xHarbour o Harbour o que falta algun parametro u opcion en la aplicacion, quien sabe RF pueda darnos ideas
saludos
Marcelo
|
ADS -> Optimizacion de consultas SQL
|
Carles:
Una pregunta.... y creo que tiene que ver con la forma en que estas trabajando.... ¿tienes indice asignado para esa tabla DBF ?
|
ADS -> Optimizacion de consultas SQL
|
Hola a todos,
Marcelo:
1.- He probado en ADSCreateSQLStatement("SQLarea",2), todos los parametros posibles, y realmente solo funciona con el 2 (ADS_CDX)
[quote:o4kpfoyz]Yo, utilizo SQL de manera nativa con ADS, es realmente comodo y muy potente.[/quote:o4kpfoyz]
Pero de manera nativa, te refieres instalando el driver ODBC, no ?. Justamente, quiero evitar q el cliente se tenga de instalar y parametrizar el Odbc.
Quizas otra manera seria probar la coña del ADO, pero me parece q tambien implica instalar en cada cliente algun componente, no se , no experimentado. Habeis hecho alguna prueba con ADO con reultado satisfactorio ? (siempre hablamos de ADS, eh <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> )
Rene:
El ejemplo de arriba tanto si lo ejecutas con una tabla con indice como sin indice, tarda lo mismo. Uhmm no se. Quizas me estoy metiendo en un tema q no tiene solución.
Todo parte de la idea que desde un solo exe, obtener esta potente funcionalidad como hace el ARC32. Tendre obsesion con este tipo <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Gracias por vuestras ideas.
|
ADS -> Optimizacion de consultas SQL
|
Hola,
He instalado el ODBC de ADS para realizar test. El resultado sobre 100000 registros es para la Sql "Select first, last, age from test where age > 90"
1.- Si quiero los una pagina de 30 registros -> 0.2 seg.
2.- Si selecciono todos los registros de la condicion (11.000 +-) -> 2.5 seg.
El driver de ADS realmente va muy rapido, pero se sale del objetivo de jugar con las funciones nativas.
|
ADS -> Optimizacion de consultas SQL
|
Hola Carles,
Por dos motivos va mas rapido ARC32 que el programa.
1. La consultas SQL "Select * from Test where age > 90" no necesita hacer una sql. Lo que hace es abrir la tabla ADT con un filtro. Se puede comprobar si hace esto, porque los nombres de los campos aparecen en mayúscula. En caso contrario, necesita ejecutar la SQL, se ven en minúscula
2. y mas importante. En caso de tener que hacer la SQL devuelve sólo los primeros 20 +- registros. Al dar Ctrl+Fin calcularía toda la sql y se vería el tiempo real que tarda.
Recuerda que al ejecutarlo con ADSExecuteSQLDirect, lo que tiene que hacer es ejecutar toda la sql, no sólo los 20 primeros registros y introducirlos en un tabla temporal para poder usarlo en el programa.
|
ADS -> Optimizacion de consultas SQL
|
Hola Fernando,
[quote:1hj17352]Por dos motivos va mas rapido ARC32 que el programa.
1. La consultas SQL "Select * from Test where age > 90" no necesita hacer una sql. Lo que hace es abrir la tabla ADT con un filtro...[/quote:1hj17352]
Entiendo q ARC32 abre una tabla en formato ADT ? Como puede ser si la tabla es una dbf normal y corriente ? No se si me explico. Cuando tu haces una query normal...
[url=http://imageshack.us:1hj17352][img:1hj17352]http://img104.imageshack.us/img104/6255/arc326xb.jpg[/img:1hj17352][/url:1hj17352]
arc32 no creo q abra la dbf y le pone un filtro. O si ? Tampoco creo q abra usando ODBC porque si no tienes el driver instalado funciona igual. Mi pregunta es, como poder emular la velocidad de arc32 sin tener q usar ODBC y ADO. Crees q se puede ?
Gracias por tu opinion
|
ADS -> Optimizacion de consultas SQL
|
Hola,
Aunque lo que abras sea una dbf, lo que abres es la DBF, no una consulta sobre la DBF. Esto lo hace si trabajas en modo Server, no en modo local.
Comprueba como, por ejemplo, te deja cambiar los valores que te ha devuelto. Si fuera una SQL no permitiría cambiar los valores.
Prueba ejecutando:
"Select {STATIC} frist, last, street, age FROM test WHERE age>90".
o cualquier consulta que unas tablas, esas no se dejan editar.
[code:b2xyrry6]Mi pregunta es, como poder emular la velocidad de arc32 sin tener q usar ODBC y ADO. Crees q se puede ?[/code:b2xyrry6]
Yo no conseguí lograrlo.
De todas formas, recuerda que tiene que generar una DBF temporal para devolverto en el alias que indicas, y ahí es donde esta el tiempo. Cuando mas campos pidas y mas registros tenga de devolver mas lento irá.
Mi consejo:
Pide los campos indices, única y exclusivamente en la consulta. Luego el resto de los datos optenlos a traves de buscarlos en la DBF original
[code:b2xyrry6]LOCAL consulta := "Select frist from Test where age > 90"[/code:b2xyrry6][code:b2xyrry6]FOR nI := 1 TO 20
Test->( DbSeek(SqlArea->Frist) )
cTxt += sqlarea->first + ' ' + Test->last + ' ' + Test->street + ' ' + str( Test->age ) + CRLF
sqlarea->( DbSkip() )
NEXT [/code:b2xyrry6]
Siendo "Test" el alias de la dbf previamente abierta sin ningun tipo de filtro aplicado y "frist" el campo indice de la misma
|
ADS -> Optimizacion de consultas SQL
|
Holas,
bueno segun se, si haces una consulta sobre una tabla sin realizar un join, es decir sin que intervenga otra tabla, lo que ADS nos devuelve es un cursor dinamico y por eso que ARC te da las cabeceras en mayusculas, pero en tu aplicacion xHarbour tu optienes ese cursor dinamico en la tabla temporal, aqui lo interesante, podriamos probar de realizar modificaciones sobre ese cursor (resultado) y deberiamos ver que las modifiacciones seran reflejadas en la tabla original, no pasara esto cuando la consulta se haga sobre mas de una tabla donde el resultado sera un cursor estatico.
Con esto da que pensar que si ADS con una consulta estatica tan solo aplica un filtro sobre la tabla objeto ( Como lo dice fernando )
Creo que deberia ayudarnos algun guru de ADS
saludos
Marcelo
|
ADS -> Optimizacion de consultas SQL
|
Marcelo, Fernando,
Gracias por vuestras opiniones. Intentare realizar ejemplos de testeo si puedo este fin de semana, aplicando filtros AOF, consultas dinamicas y estaticas, a ver q conclusion puedo sacar. Cuando termine, intentare publicarlo aqu.
Gracias.
|
ADS -> Optimizacion de consultas SQL
|
Carles,
es como te digo una consulta sobre una sola tabla te genera un cursor dinamico cuya modificacion la hace ne la tabla original, eso significa que el resultado es la tabla original con un filtro aplicado sobre ella, como lo dijo Fernando.
Haber pero esperemos que pasa el fin de semana con tus pruebas
saludos
Marcelo
|
ADS -> Optimizacion de consultas SQL
|
Hola Marcelo,
Si, si..., esta claro pero entonces por lo que estoy experimentando, una consulta sobre una sola tabla es muuuucho mas lento, que aplicar un DBSetFilter(). Si yo creo una consulta sobre una tabla de 1 millon de registros, con esta select "Select {static} first, last, state, age form test where age > 90 and state = 'DE' ", usando la funcion ADSExecuteSqlDirect(), el sistema demora aprox. 4.5 seg. En cambio si uso DBSetFilter( bCode, cCode ), el sistema va como una bala 0.02 seg., y con la diferencia que puedes actualizar la tabla.
Uhmmm, tiene que haber algo mas que diferencie la aplicacion del filtro (segun el help un live cursor) y un static cursor. La pregunta seria: Que se puede hacer o que ventajas tiene un filtro frente a un static cursor.
En fin, vamos a ver...
Buen fin de semana.
|
ADS -> Optimizacion de consultas SQL
|
Hola,
Es normal que ADSExecuteSqlDirect() tarde mas que DbSetFilter para la sql que indicas (Select {static} first, last, state, age form test where age > 90 and state = 'DE'). Pero ojo depende del número de registros que cumplan la condición.
Si son muchos los que cumplen, es mejor usar DbSetFilter, ya que ADSExecuteSqlDirect() tiene que crear un DBF temporal con todos los registros, osea, uno a uno ir añadiendo registros en una DBF. Sin embargo con DbSetFilter lo único que haces es aplicar un filtro sobre una tabla ya abierta.
Sin son pocos los que cumplen, es mejor usar ADSExecuteSqlDirect(), ya que no va a tardar en añadirlos a la DBF temporal que crea y sin embargo DbSetFilter te puede dar problemas si vas a usar un browse, porque problamente para saltar de un registro a otro tarde, al tener que validar si los registros intermedios cumplen la condición indicada.
|
ADS -> Optimizacion de consultas SQL
|
Hola,
Finalmente pude realizar mis testeos y aquí os mando un resumen. Si alguien cree q estoy errado o quiere ampliar en algo, le agradeceria q lo posteara. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Un cursor es el controlador de una tabla que se ha producido como consecuencia de realizar una consulta via SQL. Estos cursores los podemos diferenciar como dinamicos o estaticos. Dichos cursores los podemos gestionar como los controladores de una tabla y su funcionalidad es la misma.
El hecho de usar la funcion AdsExecuteSqlDirect(), hace que ADS trabaje de 2 posibles maneras.
a.- Cursor dinamico. Si puede aplicar un filtro a la tabla, crea una vista con los campos implicados y devuelve el cursor. Es posible la modificacion del registro.
b.- Cursor estatico. Se crea una tabla con los campos implicados y rellena los registros con los que cumplen la sql. No es posible su modificacion.
Es posible en algun caso forzar un cursor estatico poniendo la clausula {estatic}. Mas adelante describo un caso en que es aconsejable su uso
Que diferencias, sin embargo, existen entre un tipo de cursor y otro., El cursor estatico es mas lento de crearse porque se crea la tabla y se rellena con los registros resultantes pero en la consulta podemos usar (sacado del help de ads):
• DISTINCT in the SELECT clause
• Joins (inner, outer, self, or UNION)
• Any aggregate function
• GROUP BY or HAVING clauses
• Subqueries
• Certain scalar functions (see Scalar Functions in a WHERE Clause)
• If a memo field is used in a WHERE clause (e.g., WHERE memo is null)
• LIKE operator is used in a WHERE clause (e.g.,. WHERE lastname LIKE 'Smith%)
• Expressions or scalar functions in the select list (e.g., select UCASE(lastname) … )
• TOP in the SELECT clause
Es logico pensar que si no usamos una de estas clausulas, crear un filtro en la tabla via DbSetFilter(), es lo mejor, pero tenemos de analizar los caso en que aplicar un sistema u otro en funcion del tamaño de la tabla, el numero de aciertos conseguidos y el tipo de consulta:
Los test realizados son a partir de la tabla Test.dbf con 1 millon de registros. En el test, se intenta:
1.- Aplicar un DbSetFilter() y AdsExecuteSqlDirect() (en algun caso forzar la consulta statica).
2.- Consulta sobre un campo normal y con indice
3.- En el caso en que hay 3 registros de resultado se han insertado previamente en el registro 1, 500000 y 1000000.
Los resultados los tengo en una hoja excel y los he intentado plasmar en un fichero txt. Espero que se entienda.
[code:3k9qezv6]
****
Test
****
Id Reg
aprox Index Funcion Consulta
-- ----- ----- --------------------- -----------------------------------------------------------------------------------
1 2200 AdsExecuteSQLDirect() Select first, last,state, age from test where age > 90
2 AdsExecuteSQLDirect() Select {static} first, last,state, age from test where age > 90
3 DbSetFilter() age > 90
4 80000 first AdsExecuteSQLDirect() Select first,last,state, age form test where first >= 'A' and first <= 'B'
5 AdsExecuteSQLDirect() Select {static} first,last,state, age form test where first >= 'A' and first <= 'B'
6 DbSetFilter() first >= 'A' .and. First <= 'B'
7 AdsExecuteSQLDirect() Select first,last,state, age form test where last >= 'A' and last <= 'B'
8 AdsExecuteSQLDirect() Select {static} first,last,state, age form test where last >= 'A' and last <= 'B'
9 DbSetFilter() last >= 'A' .and. last <= 'B'
10 3 first AdsExecuteSQLDirect() select first, last, state, age from test where first = 'Dummy'
11 AdsExecuteSQLDirect() select {static} first, last, state, age from test where first = 'Dummy'
12 DbSetFilter() first = 'Dummy'
13 AdsExecuteSQLDirect() select first, last, state, age from test where last = 'Dummy'
14 AdsExecuteSQLDirect() select {static} first, last, state, age from test where last = 'Dummy'
15 DbSetFilter() last = 'Dummy'
16 8648 first AdsExecuteSQLDirect() Select * from test where first like 'Fra%'
17 AdsExecuteSQLDirect() Select {static} * from test where first like 'Fra%'
18 DbSetFilter() ***
19 AdsExecuteSQLDirect() Select * from test where last like 'Fra%'
20 AdsExecuteSQLDirect() Select {static} * from test where last like 'Fra%'
21 DbSetFilter() ***
22 3 first AdsExecuteSQLDirect() Select * from test where first like 'Fra%'
23 AdsExecuteSQLDirect() Select * from test where last like 'Fra%'
24 DbSetFilter() ***
**********
Resultados
**********
Id Tiempo Listar
Funcion 100 reg. Browse() Update Trafico
-- ------- -------- -------- ------ -------
1 38,72 0,03 Muy Lento Si Si
2 8,34 0,03 Rapido
3 0,02 0,01 Rapido Si
4 26,99 0,03 Muy Lento Si Si
5 3 0,03 Rapido
6 0,02 0,02 Rapido Si
7 9,31 0,03 Muy Lento Si Si
8 3,88 0,03 Rapido
9 0 0,02 Rapido Si
10 0,03 0,09 Lento Si Si
11 0,01 0 Rapido
12 0,01 1,59 Lento Si
13 1,73 0,09 Lento Si Si
14 12,88 0 Rapido
15 0,03 8,63 Lento Si
16 0,05 0,03 Rapido
17 2,91 0,03 Rapido
18
19 16,33 0,03 Rapido
20 17,92 0,03 Rapido
21
22 0,03 0,02 Rapido
23 16,34 0,02 Rapido
24
[/code:3k9qezv6]
Es curioso al final, como mi principal obsesion, que era la de ir ‘rapido’ como Arc32 se ha cumplido.
[code:3k9qezv6]
1.- En el caso de la busqueda last = ‘Dummy’ (3 registros):
Arc32 9.2
DbSetFilter() 8.63
2.- En el caso de la busqueda first = ‘Dummy’ (3 registros con indice)
Arc32 0.33
AdsExecuteSqlDirect() 0.32
3.- En el caso first = ‘Fra%’ (indice)
Arc32 0.04
AdsExecuteSqlDirect() 0.05
4.- En el caso last = ‘Fra%’
Arc32 17.78
AdsExecuteSqlDirect() 16.33
[/code:3k9qezv6]
Todo depende de q funcion usar y para que (si queremos porcesar en tablas internas, en browse,…). Gracias Fernando y Marcelo por vuestra ayuda. Si alguien quiere el programa de test para ampliar sus testeos, que me lo pida que se lo mandare.
Nota: No queria dormir a nadie, pero es lo q hay... <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->
|
ADS -> Optimizacion de consultas SQL
|
Retomo este hilo debido a que estoy porbando trabajar con SQL en ADS.
Utilizao la versión 6.2, de ADS.
Tengo lo siguiente
[code:3bzgd75l]
cCount := 'Select Count(*) FROM '+::aDbFile[_LOCALIDAD]+" where CProv='"+cCProv+"'", ;
cConsulta:= 'Select * FROM ' +::aDbFile[_LOCALIDAD]+" where CProv='"+cCProv+"'", ;
...
if ADSExecuteSQLDirect( cCount )
MsgMeter( {|oMeter,oTxt| oMeter:nTotal:= SQLarea->Expr , ;
ADSExecuteSQLDirect( cConsulta ), ;
::aLocalidades:= ::CargaArr( oMeter, oTxt ) }, "", "Cargando Tabla..." )
[/code:3bzgd75l]
ADS me responde con con un msg de error de que primero debo cerrar la primer consulta. Como lo hago?
Tambien de este ejemplo observo que en el sample se usa AdsDisconnect(AdsGetConnectionHandle()) donde, AdsGetConnectionHandle() parece no estar en la version 6.2 puede ser?
Es suficiente con AdsDisconnect() ?
muchas gracias
|
ADS -> Optimizacion de consultas SQL
|
Hola Mario,
1. Antes ejecutar ADSExecuteSQLDirect tienes que ejecutar ADSCreateSQLStatement para crear el alias donde guardará el resultado de la consulta.
2. Antes dejecutar ADSCreateSQLStatement si no pasas el alias de la aplicación a 0 ( DbSelectar(0) ) reutiliza el alias seleccionado en lugar de crear uno nuevo.
|
ADS -> Optimizacion de consultas SQL
|
Fernando; disculpá la ignorancia. Pero soy principiante tanto en esto como en comandos SQL.
Mi codigo es el siguiente
[code:2epczb8q]
CLOSE ALL // Es una aplicación ya implementada por lo quer cierro todo
AdsConnect( ::oMG:cDirDbf, 2 )
DbSelectAr( 0 ) // Lo incluyo aquí
if !ADSCreateSQLStatement( "SQLarea",2 ) // 2 == ADS_CDX
MsgAlert( "Fallo en la conexión SQL" )
return( lOk)
endif
if ADSExecuteSQLDirect( cCount )
MsgMeter( {|oMeter,oTxt| oMeter:nTotal:= SQLarea->Expr , ;
wqout({ ADSExecuteSQLDirect( cConsulta ) }), ;
::aLocalidades:= ::CargaArr( oMeter, oTxt ) }, "", "Cargando Tabla..." )
else
AdsDisconnect()
SQLarea -> ( DbCloseArea() )
return( lOk )
end
[/code:2epczb8q]
No entiendo donde incluir DBSelectAr( 0 ); probe incluirlo previo a ADSCreateSQLStatement() y el mensaje sigue siendo el mismo: "The cursor from the previous execute must be closed..."
La otra pregunta es AdsDisconnect(), declarado así, es suficente?
Y por último, donde puedo leer ayuda sobre estas, y otras, funciones.
muchas gracias por tu tiempo
|
ADS -> Optimizacion de consultas SQL
|
Mario,
Aisla tu codigo con este pequeño ejemplo, y te deberia funcionar. En este ejemplo abro una tabla, muestro el browse, preparo una consulta a otra tabla, muestro resultado, y finalmente retorno al primer browse.
[code:3n839mdj]#include "ads.ch"
#include "fivewin.ch"
*--------------
FUNCTION main()
*--------------
LOCAL cServer := "\\BSD001\Test"
LOCAL consulta := "Select * from tsqlcdx where age > 90"
LOCAL cTxt := ''
RddRegister("ADS",1)
RddSetDefault("ADS")
AdsSetServerType ( 2 )
SET FILETYPE TO CDX
IF AdsConnect( cServer , 2 ) == .F.
MsgAlert( 'Error en conexion' )
RETU .F.
ENDIF
USE \\BSD001\Test\customer NEW SHARED
cAlias := Alias()
(cAlias)->( Browse() )
nArea := Select()
DbSelectAr( 0 )
IF ! ADSCreateSQLStatement("SQLarea",2) // 2 == ADS_CDX
MsgAlert( "ADSCreateSQLStatement( 'SQLArea', 2 )" )
AdsDisconnect(AdsGetConnectionHandle())
RETU .F.
ENDIF
IF ADSExecuteSQLDirect( consulta )
FOR nI := 1 TO 20
cTxt += SQLArea->first + ' ' + SQLArea->last + ' ' + SQLArea->street + ' ' + str( SQLArea->age ) + CRLF
SQLArea->( DbSkip() )
NEXT
MsgInfo( cTxt )
ENDIF
SQLArea -> ( DBCLOSEAREA() )
(cAlias)->( Browse() )
(cAlias)->( DbCloseArea() )
AdsDisconnect(AdsGetConnectionHandle())
RETU NIL
[/code:3n839mdj]
En cuanto a la pregunta del uso del AdsDisconnect() le tienes q pasar de parametro el handle de la conexion, por eso se usa AdsDisconnect(AdsGetConnectionHandle())
Q yo sepa la unica ayuda q puedes tener es ladel help de ADS en la q estan todas las funciones y/o algun anima caricativa en el foro <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
ADS -> Optimizacion de consultas SQL
|
Carles:
Gracias por la ayuda.
Respecto de AdsGetConnectionHandle()
Al compilar me devuelve el error de abajo. Por eso aclaré que uso ADS 6.2 y preguntaba si la función no será de una version posterior
Generating C source output to 'WAT_T01.c'...
Done.
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
WAT_T01.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN_ADSGETCONNECTIONHANDLE' referenced from D:\FUEN32\WAT5\RELEASE\WAT_T01.OBJ
mgat - 0 error(es), 2 advertencia(s)
Por otro lado realicé una llamada a AdsDisconnect() y me devuelve verdadero; por lo supongo que desconecta. Es así?
Saludos
|
ADS -> Optimizacion de consultas SQL
|
Hola,
El error esta en la segunda consulta SQL. Al intentar generarla te dice que cierres la primer consulta
[code:1w26sm9h]MsgMeter( {|oMeter,oTxt| oMeter:nTotal:= SQLarea->Expr , ;
wqout({ ADSExecuteSQLDirect( cConsulta ) }), ;
::aLocalidades:= ::CargaArr( oMeter, oTxt ) }, "", "Cargando Tabla..." ) [/code:1w26sm9h]
Cada consulta SQL debe tener su propio ADSCreateSQLStatement, sino intenta reutilizar el alias anterior "SQLarea" que esta en uso.
Yo pondría lo siguiente:
[code:1w26sm9h]MsgMeter( {|oMeter,oTxt| oMeter:nTotal:= SQLarea->Expr , ;
dbSelectar(0),;
ADSCreateSQLStatement("SQLarea2", 2),;
wqout({ ADSExecuteSQLDirect( cConsulta ) }), ;
DbSelectar("SQLarea"),;
::aLocalidades:= ::CargaArr( oMeter, oTxt ) }, "", "Cargando Tabla..." ) [/code:1w26sm9h]
El motivo del DbSelectar(0), es para que no haya una tabla activa. Ya que sino perderas los datos de la consulta inicial y las dos tablas "SQLarea" y "SQLarea" tendrán los mismo valores, apuntarán a la misma tabla.
|
ADS -> Optimizacion de consultas SQL
|
Buen día,
Retomo este hilo porque estoy intentando comenzar con las query en ADS ya que hasta ahora no lo he usado.
Uso DBF's con CDX's.
Dentro de estos post encontré un ejemplo de query que funciona correctamente pero la consulta es porque si la DBF a la cual le hago un query está siendo usada por otra terminal ( con un alias, como una DBF comunmente se usa), el query dá error y lo mismo pasa si uso el architect y ejecuto un query a una dbf abierta. Aclaro que uso ADS Server 9
necesitaría una ayuda en esto para poder avanzar. Gracias.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
ADS 10
|
Hola a todos.
Me gustaría pasar mi aplicación al motor de bb.dd. ADS10.
Tengo xHarbour y FW10.2, hay alguien que este trabajando en esta plataforma, en principio me surgen muchas dudas.
Gracias.
|
ADS 10
|
Manuel,
Luis Krause y Brian Hays son usuarios de ADS desde hace muchos años, contacta con ellos seguro que te ayudarán a aclarar dudas, etc
|
ADS 10
|
Gracias, Antonio.
Voy a intentarlo.
|
ADS 10
|
Hola,
Este es el código que debes añadir al comienzo:
1) Call the ADS Service:
REQUEST ADS
2) Set the RDD Default
RddSetDefault("ADS") // just ADS, data file type comes later
3) Set the Server type:
AdsSetServerType(7) // 1-Local 2-Remote 3-Local+Remote 4-Internet
5-Internet+Local 6-Internet+Remote, 7-All of them
4) Set the file type
AdsSetFileType(2) // 1- DBFNTX 2- DBFCDX 3- ADTADI
Y listo.
|
ADS 10
|
Quiero dar las gracias públicamente a Luis Krause, por su ayuda para tener en mi aplicación la posibilidad de usar los motores de bb.dd. de ADS.
Ya lo he conseguido gracias a el u ahora estoy en fase de testeo, de momento todo va a las mil maravillas.
Saludos.
|
ADS 10
|
Hola:
¿Has tenido problemas con los filtros?
|
ADS 10
|
Mis pruebas aun no son muy extensas, pero de momento lo único q detecto de los filtros es q son extremadamente mas rápidos q en el RDD nativo de xHarbour, ven muy bien.
|
ADS 10
|
Hola:
ADS no soporta filtros del tipo SET FILTER TO &cCondicion.
En efecto, las mejoras de velocidad son muy notables.
¿Usas el servidor o el modo local?.
Cambiando ads.cfg se puede poner hasta 20 usuarios sin necesidad de tener el server.
¿Has probado el acceso a los datos via internet?
|
ADS 10
|
Manuel:
Podrías orientarme un poco en sacarle partido al ADS. Sobre todo en el tema de filtros y si hay posibilidad de crear indices temporales.
Un saludo
José Luis
|
ADS 10
|
Hice algunas pruebas con el servidor en local y remoto no lo utilice via internet, y el rendimiento en general en red local era bastante peor que el DBFCDX nativo, por lo tanto decidí no continuar investigando con ADS.
Ahora están creciendo algunas alternativa como RDDNet de Harbour, hay q esperar a ver como evolucionan.
Saludos.
|
ADS 10
|
Agrego:
Aparte del REQUEST ADS hay que agregar
EXTERNAL OrdKeyCount, OrdkeyNo (Caso contrario hay problemas con los browses)
En cuanto a los filtros, ADS dispone de filtros muy veloces a traves de la función AdsSetAOF() con la particularidad de que si el Filtro se define por un campo indexado, la función usa tal índice.
Las funciones DbFilter(), DbClearFilter() son validas cuando hay filtros activos
Saludos
|
ADS 10 with tremendous performance increase
|
Only for information purposes for ADS users:
With ADS 9.x, xBrowse was not as performant as with e. g. RMDBFCDX, especially the time for building the browse and switching sorting needs significant time with big tables.
With ADS 10 the performance increased tremendous, there are no (NO) boring time lacks anymore! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
ADS 10 with tremendous performance increase
|
Any Idea why ????
Can us ask the ADS Support
tx
|
ADS 10 with tremendous performance increase
|
Uwe,
here you find more informations:
<!-- m --><a class="postlink" href="http://devzone.advantagedatabase.com/dz/content.aspx?key=1">http://devzone.advantagedatabase.com/dz ... aspx?key=1</a><!-- m -->
<!-- m --><a class="postlink" href="http://devzone.advantagedatabase.com/dz/content.aspx?key=44&id=3a0d57b5-ba35-2e45-9858-4ab8786f8990">http://devzone.advantagedatabase.com/dz ... b8786f8990</a><!-- m -->
<!-- m --><a class="postlink" href="http://blog.advantageevangelist.com/">http://blog.advantageevangelist.com/</a><!-- m -->
But I don't know the reasons in details, particularly not the dependencies with xBrowse. Might be a combination of:
- Improved AdsKeyCount()
- Caching
- AdsRightCheck
- etc.
You can also try to contact Joachim Dürr via one of the newsgroups, he's the german ADS specialist. Unluckily he uses Delphi and not FiveWin <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
|
ADS 11
|
Want to see what's on version 11?
Check it out:
[url:1w4bpygz]http://link.brightcove.com/services/player/bcpid69180322001?bckey=AQ~~,AAAACw_M05E~,yCxYCFygI4FwTqVim65-JlI22Yu-fwcr&bctid=1762457211001[/url:1w4bpygz]
Reinaldo.
|
ADS 5132 Errors / Struggles with Internet and Local Server
|
I am using Advantage Database Server version 8.1
I have the AIS portion of my system running like a charm. However, I want to switch to ALS and create temp tables here and there in my code. I cannot seem to figure out how to use *both* ALS and AIS in the same application.
Can someone help me out? My specific question is how to COPY STRUCTURE, USE, etc. using ALS when I have an active .ADD
connected via AIS.
TIA
Andy
|
ADS 5132 Errors / Struggles with Internet and Local Server
|
TIA,
See:
AdsCopyTableStructure()
Regards
|
ADS 5132 Errors / Struggles with Internet and Local Server
|
[quote="arpipeline":1id5wl8z]I am using Advantage Database Server version 8.1
I have the AIS portion of my system running like a charm. However, I want to switch to ALS and create temp tables here and there in my code. I cannot seem to figure out how to use *both* ALS and AIS in the same application.
Can someone help me out? My specific question is how to COPY STRUCTURE, USE, etc. using ALS when I have an active .ADD
connected via AIS.
TIA
Andy[/quote:1id5wl8z]
Mr. Andy,
I have a similar application which uses both ADS and ALS at the same time.
[code=fw:1id5wl8z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> ...<br /> hADS := <span style="color: #000000;">0</span><br /> hALS := <span style="color: #000000;">0</span><br /><br /> lServerOK := ADSConnect60<span style="color: #000000;">(</span> <.add location>,<span style="color: #000000;">4</span>,<span style="color: #ff0000;">'adssys'</span>,,,@hADS<span style="color: #000000;">)</span><br /> ...<br /> lLocalOK := ADSConnect60<span style="color: #000000;">(</span> <.add location>,<span style="color: #000000;">1</span>, <span style="color: #ff0000;">'adssys'</span>,,,@hALS<span style="color: #000000;">)</span><br /> ...<br /><br /> </div>[/code:1id5wl8z]
Use this to switch your connection
[code=fw:1id5wl8z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br /><br />AdsConnection<span style="color: #000000;">(</span> hADS <span style="color: #000000;">)</span> <span style="color: #B900B9;">//switch to ADS handle</span><br />...<br /><br />AdsConnection<span style="color: #000000;">(</span> hALS <span style="color: #000000;">)</span> <span style="color: #B900B9;">//switch to ALS handle</span><br />...<br /><br /> </div>[/code:1id5wl8z]
All other ADS operation are standard.
Regards,
-Frances
|
ADS 7 - 11 with Harbour ?
|
I have source code built into .Exe's using two different resources:
X = xHarbour(.com) with Pelles C
M = Harbour plus MSVC
The same code is used in both cases.
The problem is this. With the libraries we have tried, Building with X allows us to use ADS server versions 7 through 11. Building with M will only allow us to use ADS 9 through 11.
There was a clear change with ADS 9. However, the calls I make are present in all versions of ADS. We just can't get the right libs built to allow me to access all versions of ADS from 7 to 11 under the Harbour build.
I have many clients who use ADS 7 or 8, and they are not willing to spend the money to update to a new version of ADS.
Has anyone actually used this combination ( Harbour, FWH, MSVC ) with ADS versions 7 through 9 ? Your help would be appreciated.
Tim
|
ADS 7 - 11 with Harbour ?
|
Hi Tim;
I don't think you need special builds. Obviously your harbour code does not make use of any fucntion/feature introduced after ver 7. An older client can always speak to a newer server. The opposite is not true. Therefore, <in your case> I would simply build my apps targeting version 7. Make sure you distribute ace32, adsloc32.dll, axcws32.dll or any other ADS .dll and .libs from version 7 to all your customers. Regardless if they are running version 11 of the server, the client will connect and the server will "understand" version 7 from the client side.
Hope that helps,
Reinaldo.
|
ADS 7 - 11 with Harbour ?
|
Reinaldo,
The issue is not with the the server, or .dlls, but rather the .libs I have available to link in to the application.
The libs for xHarbour will NOT work with Harbour. Trying to build .libs for Harbour has been a failure to date. We can get it to work with ADS 9 and above, but not 7 and 8.
Tim
|
ADS 7 - 11 with Harbour ?
|
Why? I mean, why you say it won't work? Do you get an error message? Do you get a gpf? Don't you get to AdsConnect60() to the server? Do you get 7078 error message? Is the server discovery processes not working? Is the failure building rddads.lib? if so, then do you get error message while trying to compile .c files that make up rddads.lib?
I have never built rddads.lib for harbour using msvc, but the process should be the same. I bet your harbour build (the one not working), is being built with a .lib that was created from .dlls that belong to version 9 or you haven't set the environmental ADS version variable correctly when compiling the .c sources. Again, any version of the client will work with version 11 of the server.
Reinaldo.
|
ADS 7 - 11 with Harbour ?
|
Tim;
In case the problem is building rddads.lib or if you haven't been able to build your own rddads.lib or are having problems building it, here is a post I did sometime ago that explains how to do it. On this post I also explain a few concepts about the rddads.lib that you might find interesting:
[url:2l5d9rtq]http://structuredsystems.blogspot.com/[/url:2l5d9rtq]
Hope that helps,
Reinaldo.
|
ADS 7 - 11 with Harbour ?
|
I will review the post.
Actually Antonio tried building the .lib files because he had all of the source files necessary for Harbour.
I got to a point where I could do the build, but received an error message when trying to access the server. Originally I was getting an Ordinal 508 error when trying to build it.
I'll read your material and then check out another thought I had ....
Tim
|
ADS 7.1 to ADS 8.1
|
Hello!After I removed ADS Local server (7.1) and it associated files and then install ADS Local server (8.1)... I encountered this strange problem...here's the code...[code:154ss81z]
hADS := 0
cCurrentRDD := 'ADS'
lADSServer_OK := ADSConnect60( aIni[ cDATABASEPATH ], aIni[ nCONNECTTYPES ], 'user', '***')
If lADSServer_OK
hADS := AdsGetConnectionHandle()
Request ADS
rddRegister( cCurrentRDD, 1 )
rddsetdefault( cCurrentRDD )
Extern ADSKeyNo
Extern ADSKeyCount
Extern ADSSetRelKeyPos
Extern ADSGetRelKeyPos
AdsSetFileType( ADS_CDX )
AdsSetCharType("OEM")
AdsLocking( .T. )
AdsSetDateFormat( "MM.DD.YYYY" )
AdsSetEpoch( 1930 )
AdsSetDeleted( .F. )
//
DBSelectArea( 1 )
dbUseArea(.T., cCurrentRDD, 'RESPON', 'RE', .T., .F.)
IF !NetErr()
RE->( OrdSetFocus('RespNam') )
ELSE
cTableErrors += 'RESPON Table ' + CRLF
END
//
[/code:154ss81z]
the above code works perfectly with both 7.1 and 8.1 BUT...
[code:154ss81z]
RE->( dbEval( {|| AAdd( aListBox_RESPONSIBILITY, {RE->RESPCOD,RE->RESPNAM} ) } )) [/code:154ss81z]
dbEval >> DOES NOT WORK WITH 8.1 ....Apps closes without any message even within begin..sequence construct..
[code:154ss81z] MsgInfo(RE->RESPNAM) [/code:154ss81z]Doe not even work too! Any pointer?Regards, <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
|
ADS 7.1 to ADS 8.1
|
[b:3apf1b24]SOLVE![/b:3apf1b24]AdsGetConnectionHandle() not in ACE32.DLL (8.1) but... AdsConnection() is compatible in both 7.1 and 8.1 ace32.dllwhewww! <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> Thanks!
|
ADS 7.1 to ADS 8.1
|
Hello[code:2rbnh8yg]ADSConnect60( aIni[ cDATABASEPATH ], aIni[ nCONNECTTYPES ], 'user', '***',, @hADS)
[/code:2rbnh8yg]
|
ADS 7.1 to ADS 8.1
|
Hi!I think yours is much better.... <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> Regards,
|
ADS 8 ""LOCAL""
|
Hola,
Alguien tiene algun LINK directo para bajar el ADS 8 LOCAL FREE ???
Que limitacion de usuarios tiene ?
Salu2
|
ADS 8 ""LOCAL""
|
[quote="Hernan Diego Ceccarelli":1tmo01u0]Hola,
Alguien tiene algun LINK directo para bajar el ADS 8 LOCAL FREE ???
Que limitacion de usuarios tiene ?
Salu2[/quote:1tmo01u0]
Ya lo he bajado.
Alguien sabe si funciona bien en Windows 98 ? y el limite de usuarios ?
|
ADS 8 ""LOCAL""
|
Hernan Una consulta
Que mejoras tiene la version 8 con respecto a la version 7.1
en cuantos aplicaciones xharbour
desde ya gracias
Saludos
Patricio
|
ADS 8 ""LOCAL""
|
Por partes:
Para bajar ADS 8: <!-- w --><a class="postlink" href="http://www.google.d2g.com/ads/ver8/">www.google.d2g.com/ads/ver8/</a><!-- w -->
Server local si funciona en Win98
Limite de usuarios: 5
En cuanto al RDD para xHarbour, Bryan Hays ha escrito varias cosas nuevas para el RDDADS, como por ejemplo que puedas tener conviviendo los 3 tipos distintos de formatos de datos (DBF/CDX, DBF/NTX y ADT/ADI), se han implmentado nuevas funciones sobre todo para monitorear el servidor y otras cosillas, solo esta disponbile con (x)Harbour 99.5.1.
Del lado del servidor remoto los cambios son IMPRESIONANTES, ahora tienes replicación de tus datos DBF a otro servidor, la velocidad se ha aumentado de manera considerable, si antes era rapido, ahora siento que va como un 20% o 30% mas rapido, el acceso via internet a los datos se ha mejorado mucho en cuanto a velocidad tambien, y se ha incorporado al servidor remoto el servicio de respaldo de informacion automatico.
|
ADS 8 ""LOCAL""
|
Rene,
Cual es la version de LOCAL SERVER, que NO tiene limites de usuarios ??? (hablamos de una aplicacion NO C/S)
Salu2
|
ADS 8 ""LOCAL""
|
Jejeje, eso no existe mi estimado Hernán. si existiera, ¿ de que viviria la gente de Extended Systems ?, ADS no es solo la tecnolgia cliente servidor, es mucho, muchisimo mas, como los diccionarios de datos, los triggers, la integridad referencial, los procesos almacenados, la seguridad de los datos, cosas que los programadores de (x)harbour apenas hemos comenzado a explotar.
Hay un truco para intentar aumentar el numero de usuarios del servidor local, modificando el archivo de configuracion ADSLOC32.CFG, sin embargo este truco es totalmente inutil, el servidor local se ralentiza conforme entran mas usuarios y a partir del sexto, el sistema se vuelve mas y mas lento y no llegas alcanzas a llegar ni a 10 usuarios simultaneos cuando el sistema se vuelve totalmente inoperante por la lentitud de respuesta del server local.
Se supone que el server local no es para hacer aplicaciones que luego puedas poner en produccion, es para que tu puedas desarrollar una aplicacion y hacer pruebas sin necesidad de tener un servidor remoto instalado, por ejemplo en tu pc de casa o en tu laptop, sin embargo la facilida de tener 5 usuarios simultaneos te sirve para pequeñas aplicacoines porque funciona muy bien.
Microsoft tiene una cosa similar llamada MS2000 o SQL Lite, que segun esto es un SQL Server recortado que es gratis y puedes instalar en cualquier equipo, pero en realidad de un ACCESS con esteroides, con algunas caracteristicas del SQL server, pero no todas.
Se supone que el MS2000 es para pocos usuarios y que para mayores volumenes de datos o de usuarios se da por entendido que usaras la verson comercial de SQL Server.
|
ADS 8 ""LOCAL""
|
Gracias por las aclaraciones <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
ADS 8 ""LOCAL""
|
Para los que quieran ver mas información
[url:2khnma8a]http://www.advantage.com.uy/demo_ver8.html[/url:2khnma8a]
Saludos
Patricio
|
ADS 8 ""LOCAL""
|
Seria posible, usando solo ADS Remote, tener una Base de datos que contenga archivos (tablas, ficheros) en el servidor local y a la misma vez archivos en un servidor en el Internet?
Me explico: Necesito tener unos archivos en un servidor en una red local, pero tambien necesito que mi programa cuando accese esos archivos, tambien pueda acessar otros que esten en un servidor en el internet
George
|
ADS 8 ""LOCAL""
|
Claro que se puede....
Sin ningun problema, simplmente haces un SetServerType(7) y puedes manejar archivos via internet y servidor local sin ningun problema
|
ADS 8 ""LOCAL""
|
Rene gracias por tu aclaracion.
Como se de tu experiencia y siempre tu buena disposicion de ayudarnos en el este y otros foros, me gustaria que me diera tu opinion acerca de las ventajas y desventaja de usar MySql o ADS advantage en una nueva aplicacion que pienso desarrollar. Esta aplicacion tendra que usar archivos (tablas) simultanemame en el servidor local y en un server en el internet. Nunca he usado SQL y quiero saber si ADS Advantage tiene la misma seguridad de datos que tanto se habla tiene SQL. y si la rapidez seria tambien mas o menos igual, pues pienso desplegar, desde el servidor en Internet, dos archivos graficos.
Mi primera opcion es irme con ADS, pues es el motor de base de datos compatible con los DBF que conozco desde hace casi 20 años (wao como pasa el tiempo), De todos modo Rene cualquier sugerencia tuya la tendre muy en cuenta
Saludos
George
|
ADS 8 ""LOCAL""
|
ADS es una herramienta que proporciona a los archivos DBFs la misma tecnologia de acceso a los datos sobre la cual trabajan productos como SQL Server, Oracle, Informix, es decir, tecnologia Cliente/Servidor, lo cual garantiza un acceso optimizado a la base de datos, mayor velocidad en las operacion de los sistemas, estabilidad de los datos, cero corrupcion de indices, seguridad de la información y muchas mas ventajas adicionales:
1) ADS corre sobre cualquier servidor de red, sin importar si es Novell, Linux o Windows NT/2000/2003, porque tiene servidores de base de datos para cualquiera de estos sistemas operativos.
Si tu quisieras implementar alguna otra solucion, por ejemplo MySQL, tendrias que montar y configurar un servidor Linux, a pesar de que el costo de Linux por si mismo es casi nulo, el costo de la consultoria si es superior y casi igual al de cualquier otro servidor comercial.
Si quisieras montar SQL Server, tendrias que montar un servidor Windows NT/2000/2003, obtener licenciamiento para tus usuarios para el servidor, y ademas instalar el servidor de base de datos SQL Server, adquirir su respectivo licenciamiento, el cual es POR APLICACION que accese el servidor, no por estacion de trabajo, esto quiere decir, que si tienes en promedio 2 programas que accesan a los datos de tu servidor SQL por estacion de trabajo, y si multiplicamos esas 2 aplicaciones por 10 usuarios, esto significa que tendrias que adquirir 20 licencias de SQL Server para poder trabajar, falta agregar el costo de comprar el hardware y el software nuevo. Si te quieres dar una idea mas clara de cuanto te costaria instalar un SQL Server, mira esta pagina: <!-- m --><a class="postlink" href="http://www.microsoft.com/sql/howtobuy/default.asp">http://www.microsoft.com/sql/howtobuy/default.asp</a><!-- m -->.
Para Novell no existe ninguna base de datos, solo Oracle, pero licenciar Oracle para cualquier cantidad de usuarios sobre Novell no es una solucion viable primero porque cada licencia de Oracle es costosisima, y 2do porque para mas de 25 usuarios, Oracle sugiere que el servidor de datos se monte sobre un sistema operativo Unix, agregale entonces al costo del Oracle el costo del servidor UNIX (Sun Microsystems) y el licenciamiento respectivo. Para que te des una idea de lo que cuesta un Oracle, solo el servidor de datos varia en 15,000 y 40 mil dolares, mas aparte el costo del licenciamiento por estacion de trabajo y el hardware, puedes revisarlo aqui: <!-- m --><a class="postlink" href="http://www.awaretechnologies.com/awareWWW/oracleProducts/priceList.html">http://www.awaretechnologies.com/awareW ... eList.html</a><!-- m -->
2) Cada servidor de base de datos utiliza su propio formato nativo de archivo de datos, ADS trabaja sobre tablas DBF estandar y sobre indices NTX y CDX, tambien ofrece la posibilidad de trabajar con su propio formato nativo, tablas ADT con indices ADI, pero esto no es necesario, si no deseas hacerlo, aunque es muy recomendable Advantage trabajara con tus indices actuales y tus tablas dbf sin cambio alguno. Si quisieras implementar una solucion basada en SQL, como las mencionadas anteriormente, tendrias que migrar todos los datos que tienes en este momento al formato de archivo que maneje tu base de datos (MySQL, SQL Server, Oracle, etc), con la consabida inversion de tiempo en el proceso de migracion, y ademas tomar en cuenta que los tipos de campos no son iguales a los DBFs lo que require de analisis adicional para realizar la migracion. De manera general y eso te lo pude decir cualquiera de los colegas que ha migrado a SQL, las estructuras DBFs tienen que tirarse a la basura y se tienen que rediseñar tablas nuevas.
3) Todas las herramientas Cliente / Servidor que existen en el mercado utilizan como lenguaje para accesar a los datos SQL, Advantage Database Server no, ADS provee de capas de comunicacion que te permiten utilizar cualquier lenguaje de programacion que ya conozcas, Clipper / FiveWin, Harbour / FWH / MiniGui, Delphi, Visual Basic, ASP, PHP etc. utilizando un API de comunicacion estandar llamado ACE (Advantage Client Engine), si estas usando el cliente local de ADS en tus aplicaciones de 32 bits, entonces ya estas usando Advantage, (ACE32.LIB) para migrar tus aplicaciones a tecnolgia Cliente / Servidor ADS, solo tienes que cambiar una linea de codigo en tus programas y ¡ listo !, puedes tener tu aplicacion migrada a cliente / servidor en unas horas porque no se requieren instrucciones especiales para accesar a los datos, ADS soporta los comandos y funciones de manejo de archivos DBF e indices estandar del lenguaje de programacion que estés utilizando. Para utilizar cualquier otra base de datos SQL, tendrias que volver a escribir el acceso a los datos .... TODO, es decir, aparte de migrar de formato de base de datos, tendrias que volver a escribir los programas para que soportaran sentencias SQL.
4) ADS es una base de datos libre de mantenmiento, es decir, se instala una sola vez, se configura y listo.... no requiere de tener un administrador de bases de datos, el proceso tipico de montaje, instalacion y migracion de una aplicacion a Cliente / Servidor con ADS es de solo 2 dias, sin importar el lenguaje de programacion que estes utilizando. Los cursos y certificaciones, asi como los servicios de montaje e instalacion no estan incluidos en las otras herramientas y usalmente los costos de capacitacion e implmentacion varian entre el 30% y el 50% del precio del producto.
5) ADS reduce el trafico en la red, bajo tu esquema actual, cada archivo DBF es copiado a cada estacion de trabajo, cada operacion de COMMIT regresa el archivo al servidor, lo que ocasiona colisiones y alto volumen de trafico en la red, con la respectiva lentitud en acceso a los datos, obviamente entre mas grandes los archivos y mas usuarios accesando a ellos, mas lento se hace el programa. ADS elimina el trafico de la red hasta en un 50%, lo que hace que las aplicaciones funcionen mas rapido.
6) ADS anula los errores de corrupcion de indices. ADS centraliza toda la informacion en el servidor y es ADS quien se encarga de controlar el acceso a la misma, al no estar viajando por la red los datos, se anula totalmente el riesgo de corrupcion de indices.
7) ADS ofrece seguridad a la informacion, ofreciendo 3 esquemas de proteccion de los datos: A nivel servidor, restringiendo el acceso de los usuarios de las terminales a los archivos .DBF por medio del ocultamiento de los directorios, por medio de diccionarios de datos con niveles de seguirdad individuales para cada usuario o bien encriptando el contenido de las tablas DBF con un algoritmo de 128 bits, tambien es posible implementar ambos, requiriendo para esto agregar solo una linea de codigo en los programas. Adicionalmente ADS ofrece un sistema de transacciones para garantizar la integridad relacional de los archvios DBFs, este sistema garantiza que se realicen completas todas las operaciones de la base de datos, lo que evita que los archivos se queden "cortados", cuando el programa falla en una operacion que afecta a mas de una base de datos. ADS cuenta tambien con un esquema de recuperacion de datos perdidos en caso de caida del servidor.
<!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> ADS es rapido, cuenta con la tecnologia AOF (Advantage Optimized Filters) que permite la realizacion de filtros a travez del comado SET FILER entre 1200 y 1500 veces mas rapido que con Clipper o Harbour convencionales, adicionalmente ADS cuenta con algorimos de almacenamiento temporal que guardan todas las busquedas realizadas por todos los usuairos y proveen de una respuesta mas rapida y eficiente cuando otro usuairo pide los mismos datos, lo que quiere decir que entre mas usuarios esten utilizando el sistema, ADS ira cada vez mas rapido.
9) ADS soporta protocolo IPX y TCP/IP indistintamente y simultaneamente, puediendo tener aplicaciones dentro de una red de area local con protocolo IPX y ejecutando aplicaciones via Internet con TCP/IP utilizando el Advantage Internet Server, que se incluye sin costo en el precio de servidor ADS.
10) ADS soporta hasta 1000 usuarios simultaneos de la base de datos, y tablas DBF de hasta 4 Gigabytes de tamaño, nuestros usuarios mas grandes tienen en promedio entre 50 y 75 millones de registros por archivo DBF individual.
11) ADS reduce costos... ¿ cuanto tiempo deja de funcionar tu sistema por tener que reindexar la base de datos cuando se corrompe un indice ?... ¿ cuanto tiempo inviertes al dia en arreglas las incosistencias de la base de datos ?... ¿ cuanto dinero pierdes por no poder emitir una factura o no poder revisar una cuenta por cobrar cuando el sistema "esta caido" ?. ADS garantiza el retonro de inversion en un maximo de 6 meses.
|
ADS 8 ""LOCAL""
|
Rene
Mas que una respuesta en un EXCELENTE ENSAYO actualizado, sobre motor de base de datos, lo que tu acabas de escribir. Esto es de gran importancia para cualquier programador.
Gracias por todos tus aporte.
Saludos
George
|
ADS 8 Por las dudas.
|
Amigos:
recién bajé la version 8 Ads (Arc32) , utilidad para
manejas archivos DBF,ADT etc.
En el programa con Harbour hay que sacarle el guión
al REQUEST_ADS, AHORA VA -> REQUEST ADS
Ya lo dijo Rene antes pero como pase un rato con esto...
Saludos
Ruben Fernandez
|
ADS 8 e SQL instruciones
|
Olá,Como posso utilizar instruciones sql del ads sobre una tabela DBF/CDX?Gracias.
|
ADS 8 e SQL instruciones
|
Wanderson, este es un ejemplo en el cual uso un data dictionary[code:2k1e78c2]
#define ADS_ANY_CONEXION ( ADS_LOCAL_SERVER+ADS_REMOTE_SERVER+ADS_AIS_SERVER )
FUNCTION Main_AbrirTablas( lShared )
LOCAL lOpen := FALSE
LOCAL cErr := ""
DEFAULT lShared := TRUE
/*realiza conexion de datos*/
#ifndef _ADS_REMOTE_
IF !AdsConnect60( ".\datos\factura.add", 1, "AdsSys", "lodr",,@hConn )
#else
IF !AdsConnect60( "\\CARLOS\DATA\FACTURA.ADD", ADS_ANY_CONEXION, "AdsSys", "mipassword", , @hConn )
#endif
/*obtiene error*/
AdsGetLastError( @cErr )
/*muestra mensaje de error de conexion*/
MsgStop( cErr, "Error de conexion a servidor de datos ADS!" )
RETURN lOpen
ENDIF
/*abre tablas de datos*/
IF lShared
USE CAJA NEW SHARED ALIAS CAJA
USE CONTROL NEW SHARED ALIAS CTRL
USE USUARIOS NEW SHARED ALIAS USUA
USE PROVEEDORES NEW SHARED ALIAS PROV
USE CLIENTES NEW SHARED ALIAS CLIE
USE MOVIMIENTOS NEW SHARED ALIAS TIPO
USE FAMILIAS NEW SHARED ALIAS FAMI
USE PRODUCTOS NEW SHARED ALIAS PROD
USE MENTRADAS NEW SHARED ALIAS ENTR
USE MSALIDAS NEW SHARED ALIAS SALI
USE DENTRADAS NEW SHARED ALIAS DETE
USE DSALIDAS NEW SHARED ALIAS DETS
ELSE
USE CAJA NEW EXCLUSIVE ALIAS CAJA
USE CONTROL NEW EXCLUSIVE ALIAS CTRL
USE USUARIOS NEW EXCLUSIVE ALIAS USUA
USE PROVEEDORES NEW EXCLUSIVE ALIAS PROV
USE CLIENTES NEW EXCLUSIVE ALIAS CLIE
USE MOVIMIENTOS NEW EXCLUSIVE ALIAS TIPO
USE FAMILIAS NEW EXCLUSIVE ALIAS FAMI
USE PRODUCTOS NEW EXCLUSIVE ALIAS PROD
USE MENTRADAS NEW EXCLUSIVE ALIAS ENTR
USE MSALIDAS NEW EXCLUSIVE ALIAS SALI
USE DENTRADAS NEW EXCLUSIVE ALIAS DETE
USE DSALIDAS NEW EXCLUSIVE ALIAS DETS
ENDIF
/*bandera de apertura*/
lOpen := TRUE
/*al inicio de la aplicacion se selecciona un area vacia*/
DBSelectArea( 0 )
RETURN lOpen
[/code:2k1e78c2]
[code:2k1e78c2]
PROCEDURE Ventas_Listar2()
LOCAL cSql:=""
LOCAL cAlias := Alias()
PRIVATE oTF
/*pide rango*/
oTF:=TRango():new()
IF !oTF:lOk
RETURN
ENDIF
IF oTF:lAll
TEXT INTO cSql
SELECT A.NUMERO, B.FECHA, A.CODPRO, C.NOMBRE, A.CANPRO, A.PREVEN, A.SUBTOT, A.DESCUE, A.TOTAL, B.TC ;
FROM DSALIDAS AS A, MSALIDAS AS B, PRODUCTOS AS C ;
WHERE Left(A.NUMERO,2)='VN' AND A.NUMERO = B.NUMERO AND A.CODPRO = C.CODIGO ;
ORDER BY A.CODPRO
ENDTEXT
cSql := StrTran( cSql, ";", "" )
ELSE
TEXT INTO cSql
SELECT A.NUMERO, B.FECHA, A.CODPRO, C.NOMBRE, A.CANPRO, A.PREVEN, A.SUBTOT, A.DESCUE, A.TOTAL, B.TC ;
FROM DSALIDAS AS A, MSALIDAS AS B, PRODUCTOS AS C ;
WHERE Left(A.NUMERO,2)='VN' AND A.NUMERO = B.NUMERO AND A.CODPRO = C.CODIGO AND B.FECHA BETWEEN %1 AND %2 ;
ORDER BY A.CODPRO
ENDTEXT
cSql := StrTran( cSql, ";", "" )
cSql := StrFormat( cSql, Ads2Str( oTF:dBeginDate ), Ads2Str( oTF:dEndDate ) )
ENDIF
DBSelectArea(0)
ADSCreateSQLStatement( "REPTMP", 2 )
IF ADSExecuteSQLDirect( cSql )
DBSelectArea("REPTMP")
REPTMP->( DBGoTop() )
IF !REPTMP->( Eof() )
Ventas_Listar2R()
ELSE
MsgInfo( "No hay ventas de productos!" )
ENDIF
REPTMP->( DBCloseArea() )
ELSE
MsgStop("Error en intruccion Sql!")
ENDIF
IF !Empty(cAlias)
DBSelectArea(cAlias)
ENDIF
/*actualiza browse*/
oBrw:refresh()
RETURN
[/code:2k1e78c2]
|
ADS 8??? Crear tabla ADT
|
Amigos:
Estoy tratando de crear una tabla ADT, pero me pide
que debo establecer una conexion.
Ni idea de como hacer una conexion ya que
trabajo con ADS Local.
Se agradece cualquier ayuda.
Muchas gracias
Ruben Fernandez
|
ADS : DbSetFilter VS SQL Statement?
|
Dear All,
I use ADS but never use with SQL Statement.
How does it different speed between DbSetFilter and ADS with SQL Statement?
May I have an example to use SQL Statement to open file with ADS?
Do I need to use and Index file for SQL Statement? If so, how can I specific the index tag in SQL Statement?
Thank you in advance for any help and idea.
Regards,
Dutch
|
ADS : DbSetFilter VS SQL Statement?
|
Hi.
You must connect to an ADS data dictionary. The SQL engine is smart enough to know which indexes or combination of indexes based on the metadata on the DD should be used to produce an optimized result. No need to open tables or specify index tags.
For example, provided that you have an index based on field state and field lastname, then sql below is really fast:
SELECT * FROM customers WHERE lastname = 'Smith' AND state = 'CA'
That statement will return a cursor (like a table) with all the columns on table customers where the customer lastname field is Smith and state field contains CA. Execution happens ont he server side and the client side only receives a result set or cursor that points to the result set on the server. This makes execution really fast. Even without indexes the statement above can return a result set in less than 5 seconds when searching over 250k records, depending on the server resources. Again, the speed gains are the results of not having data travel back and forth between the client and the server in order to produce a result.
To learn how to create a data dictionary, see the examples I've posted:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23962&start=22">viewtopic.php?f=3&t=23962&start=22</a><!-- l -->
Notice that I posted a few different samples on how to create a data dictionary, tables, and indexes using regular clipper syntax as well as SQL. Just follow that same thread.
It takes some practice, but at the end you will see the benefits of using a DD other than just learning SQL.
Reinaldo.
|
ADS : DbSetFilter VS SQL Statement?
|
We are doing queries on dbf/cdx files without a dictionary. The only thing to notice is that any condition like "Where Name = 'Smith'" needs an index on Name [b:2i3fm1bu]without a condition[/b:2i3fm1bu]
The process is basically:
[code=fw:2i3fm1bu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ads.ch"</span><br /><br />Adsconnect<span style="color: #000000;">(</span><span style="color: #ff0000;">"c:<span style="color: #000000;">\p</span>athtodata"</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">select</span> <span style="color: #000000;">0</span><br /><span style="color: #00C800;">if</span> adscreatesqlstatement<span style="color: #000000;">(</span><span style="color: #ff0000;">"MYALIAS"</span>, ADS_CDX<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !adsexecutesqldirect<span style="color: #000000;">(</span>pcSQL<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Ads statement execution failed:"</span> + DNL + AdsGetErrorString<span style="color: #000000;">(</span>AdsGetLastError<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"SQL"</span><span style="color: #000000;">)</span><br /> AdsShowError<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> lSqlOk := .f.<br /> <span style="color: #00C800;">else</span><br /> lSqlOk := .t. <br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Ads statement creation failed:"</span> + DNL + AdsGetErrorString<span style="color: #000000;">(</span>AdsGetLastError<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"SQL"</span><span style="color: #000000;">)</span><br /> AdsShowError<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> lSqlOk := .f.<br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">if</span> lSqlOk<br /> <span style="color: #000000;">(</span><span style="color: #ff0000;">"MYALIAS"</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DoStuff<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span><span style="color: #ff0000;">"MYALIAS"</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DBCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:2i3fm1bu]
HTH,
Alex
|
ADS : DbSetFilter VS SQL Statement?
|
Hello Reinaldo,
I read your post and then I made a test with pure DBF.
This is what I did.
Database with 124 fields 280.000 records 500 MB.
I simulate your Select statement with a temporary index.
In the screen shot you see the technical data of my RDP – Server.
I get the result within a 1 sec.
Best regards,
Otto
05/30/12 10:33:36: Start
05/30/12 10:33:37: nach Index
05/30/12 10:51:50: Start
05/30/12 10:51:50: nach Index
05/30/12 10:51:58: Start
05/30/12 10:51:58: nach Index
05/30/12 10:52:08: Start
05/30/12 10:52:08: nach Index
[code=fw:2vj95m1n]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> test_tempIndexXbrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> use kunden <span style="color: #00C800;">new</span><br /> logfile<span style="color: #000000;">(</span><span style="color: #ff0000;">"speedtest.txt"</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Start"</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> kunden->Name + kunden->ort TAG TmpB5Nr <span style="color: #0000ff;">TO</span> TEMP5 TEMPORARY<br /> set order <span style="color: #0000ff;">to</span> tag TmpB5Nr<br /> logfile<span style="color: #000000;">(</span><span style="color: #ff0000;">"speedtest.txt"</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"nach Index"</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"kunden"</span> <span style="color: #000000;">)</span><br /> <br /> use<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:2vj95m1n]
[img:2vj95m1n]http://www.atzwanger-software.com/fw/speedrdp.jpg[/img:2vj95m1n]
|
ADS : DbSetFilter VS SQL Statement?
|
[quote="AlexSchaft":cl5k1cwy]We are doing queries on dbf/cdx files without a dictionary. The only thing to notice is that any condition like "Where Name = 'Smith'" needs an index on Name [b:cl5k1cwy]without a condition[/b:cl5k1cwy]
Alex[/quote:cl5k1cwy]
Alex;
True, you may execute SQL without a DD connection and still take advantage of indexes, but that's only true with compound indexes (cdx, adi). NTXs will not be used by the SQL engine since there is no way for the sql parser to be aware of those indexes. However, provided that you do have a dd created, then cdx, adi, and ntxs are used.
Otto;
The performance on the RDP server should be pretty much the same than on a client-server situation such as ADS, since the operation executes on the server and data does not have to flow to the workstation. Still ADS allows you to set certain tables as memory tables so that consultations to those tables are even faster. However speed is not the only consideration or benefit when considering an sql engine. Let me show in more detail some other benefits you get:
1. Triggers -You write triggers to perform validation or to perform additional tasks in response to a data operation. For example, a trigger can be used to generate a unique customer ID each time a new record is being inserted into the customer table. Likewise, a trigger can be used to write to a log table each time a change is made to a customer record. This type of operation is usually called an audit trail. I use a trigger to keep an audit trail on critical tables. I also use a trigger to create a new entry on a queue of messages to be send via email every time a pathology result is signed. The trigger is executed on the server and by the server and it will execute when the appropriate action takes place even if the table is being accessed from some other application other than your own.
2. Constraints and referential integrity. When managing many tables from many different apps it can become a nightmare to avoid orphan records on a parent child table relationship. Constraints are data dictionary based rules that Advantage can use to validate your data as it is being posted to a table. Referential integrity is a special type of constraint that ensures the data residing in two or more related tables remains consistent. You can have a RI rule to either restrict changing or to perform a cascade change of a foreign key when a primary key is changed or the record is deleted. Field constraints as well as record level constraints will ensure your data is consistent. I could enumerate a long list of real life applications for RI and constraints, but I'm going to leave it a that.
Notice that #1 and #2 are just some of ways to remove some of the business logic from the client side and moving it to the server side, never to be a concern to the developer ever again.
3. Hot-Backups. With ADS (and I suppose with any other sql engine as well), you can perform a backup of the data even while the tables are open and being used. What it does is that it creates a snap shot of the db at the moment the backup got started it.
4.Using Php, .net, perl, ADO, MDAC, OLE DB and other apps with your same data. Many times you need provide access to certain information from a browser such as ie. With Advantage you can have your main apps written as win32 with fw and still also have a php web portal where users can access certain information or all of it. Advantage also provides web services via oData standard where apps written for the iphone, android, or windows iphone can access the same dbfs that your win32 apps does. I write php web pages for my customer's customers. In this way they can access pathology results for tests they sent to the lab from any web browser anywhere.
5. Replication - With Advantage you can have many servers connected via an internet connection replicating the whole db or just some tables such that an entry in one server is visible on another server anywhere in the world. Replication can work nway, as a spoke wheel and in any dierection.
6. Stored procedures. You can have some procedures stored on the server for faster execution.
7. SQL scripting language.
8.Data security. You don't need to create a share in order to provide access to tables. The tables may reside on a directory that ins not visible to any user. A user can not copy a dbf to a pendrive or to a local drive. A user can not delete (by accident) a .dbf. The user simply does not know what the data looks like or where is it stored. Plus you can add data encryption as well as communication encryption and a lot more.
I'm going to stop here. What I mean by this is that an SQL engine opens up a whole new world we were not aware of. RDP will work great with ADS. AMOF - I use RDP for some users, but always with ADS running on the server.
Reinaldo.
|
ADS : DbSetFilter VS SQL Statement?
|
Reinaldo,
you are right in every point.
What I want to say is that RDP offers now possibilities we didn’t had before. And we should evaluate if we really need a client/server solution.
Till one understands and feels comfortable with “client server“ programming he has to learn much.
Then there are also some disadvantages like record looking which you have to care yourself I mean if you use SQL maybe ADS handles this automatically and the whole story of real – data browsing up and down.
If you browse a record set in practices you are browsing an array and without re reading you can’t say if data is actual.
BTW, we are setting up a VPN Server. I will document all the steps we take and I open a thread in the forum. I will invite all to help me to find the best setup (security!) for such a server and how we could maintain our software (updates, etc.).
So far we have a 17 points long installation guide (hiding directories, access rights, ... ). This should become a demo facility which we then suggest to our customers. VPN access is for our customers an option but the main work is done inside the LAN but always remote.
I have ordered a TB Link SafeStream™ Gigabit VPN Router. When I have it here I start and I will give you if you want access to my demo VPN Server.
Please keep in mind that I do not have to handle such sensible data like you (pathology results) . Some editions are download versions. The installation should be easy and the maintaining of the systems too.
For example a typical installation for a café: 1 ECR and up to 4 PDAs. Or a small hotel: front office, back office and a notebook.
If you use RDP you do not have to create a share. We set up a Remote Desktop user and we define which programs he is allowed to use. If he closes the program the remote session is closed automatically.
I think client/Server was developed because there was a limitation in data transfer in net. RDP solves this.
I developed my own client /server solution for my mobile application. But now the application runs on the server and the PDA is only working remote. So all this is vacant because I work local. If the connection breaks I reconnect that’s it.
You can’t imagine how many checks we inserted in this FWPPC solution: we were able to check the WIFI signal then we made the transfer. It is working but not as rock solid as the RDP solution.
The discussion and the test I made today helped me to improve my software. As I used the database with the 280.000 records I notices a speed problem which with my usually databases (10.000-20.000 records) was not noticeable.
The query took about 1 min. So I had a look into the code and I inserted a TEMPORARY index and now the speed is 1 sec.
[code=fw:a1mzgbrb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//building the query string </span><br /><br /> oKustr:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> wahl := <span style="color: #ff0000;">""</span><br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. oKustr:<span style="color: #000000;">EOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> oKustr:<span style="color: #000000;">typ</span>=<span style="color: #ff0000;">"C"</span><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>wahl<span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span><br /> wahl=<span style="color: #ff0000;">"Upper("</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">") >= "</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">left</span><span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span>,oKustr:<span style="color: #000000;">LNG</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> wahl = wahl+<span style="color: #ff0000;">" .and. Upper("</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">") >= "</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span> + trim<span style="color: #000000;">(</span>Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">left</span><span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span>,oKustr:<span style="color: #000000;">LNG</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> oKustr:<span style="color: #000000;">typ</span> = <span style="color: #ff0000;">"N"</span><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>wahl<span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span><br /> wahl=trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">">="</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> wahl=wahl+<span style="color: #ff0000;">" .and. "</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">">="</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> oKustr:<span style="color: #000000;">typ</span>=<span style="color: #ff0000;">"D"</span><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>wahl<span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span><br /> wahl=trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">">=ctod("</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">")"</span><br /> <span style="color: #00C800;">else</span><br /> * wahl=wahl+<span style="color: #ff0000;">" .and. "</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">">=ctod("</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">von</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">")"</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>><span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> oKustr:<span style="color: #000000;">typ</span>=<span style="color: #ff0000;">"C"</span><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>wahl<span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span><br /> wahl = <span style="color: #ff0000;">"Upper("</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">")<="</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">left</span><span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span>,oKustr:<span style="color: #000000;">LNG</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> wahl=wahl+<span style="color: #ff0000;">" .and. Upper("</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">")<="</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">left</span><span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span>,oKustr:<span style="color: #000000;">LNG</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> oKustr:<span style="color: #000000;">typ</span>=<span style="color: #ff0000;">"N"</span><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>wahl<span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span><br /> wahl=trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">"<="</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> wahl=wahl+<span style="color: #ff0000;">" .and. "</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">"<="</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> oKustr:<span style="color: #000000;">typ</span>=<span style="color: #ff0000;">"D"</span><br /> <span style="color: #00C800;">if</span> len<span style="color: #000000;">(</span>trim<span style="color: #000000;">(</span>wahl<span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span><br /> wahl=trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">"<=ctod("</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">")"</span><br /> <span style="color: #00C800;">else</span><br /> wahl=wahl+<span style="color: #ff0000;">" .and. "</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">feld</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">"<=ctod("</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+trim<span style="color: #000000;">(</span>oKustr:<span style="color: #000000;">bis</span><span style="color: #000000;">)</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">")"</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <br /> <br /> <br /> oKustr:<span style="color: #000000;">skip</span><span style="color: #000000;">(</span><span style="color: #000000;">+1</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDDO</span><br /> <br /> <br /> <br /> <br /> <span style="color: #0000ff;">select</span> TempKunden<br /> <span style="color: #B900B9;">//new </span><br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> TempKunden->name TAG TmpB5Nr <span style="color: #0000ff;">TO</span> TEMP5 TEMPORARY;<br /> <span style="color: #00C800;">FOR</span> &wahl<br /> nTotal := ordKeyCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> nTotal <span style="color: #000000;">)</span><br /> <br /> <br /> <span style="color: #0000ff;">select</span> TempKunden<br /> set order <span style="color: #0000ff;">to</span> tag TmpB5Nr<br /> go top<br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. EOF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/* code I used befor<br />if &wahl<br /><br />endif<br />*/</span><br /> skip<br /> <span style="color: #00C800;">enddo</span><br /> </div>[/code:a1mzgbrb]
[img:a1mzgbrb]http://www.atzwanger-software.com/fw/reportgenerator.jpg[/img:a1mzgbrb]
Best regards,
Otto
|
ADS : DbSetFilter VS SQL Statement?
|
Otto;
On the subject of RDP, I'm using a product called WinFlector. It is written with xharbour. My experience as a whole has been positive but I never use it for more than 3 users.
What are you using? Can you compare it to Winflector?
Thank you,
Reinaldo.
|
ADS ADSClearAof()
|
What needs to be setup in the link script to utilize the ADSClearAof() function. I am trying to move an application to the newer compilier and get this problem.Byron...
|
ADS ADSClearAof()
|
ByronYou will need to download the ADS 9 sdk .. use the ads.rdd from the latest xHarbour and create you a new ace32.lib based on ace32.dll from the sdk.Rick
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.