Page 1 of 1

mod_harbour and ADS server

PostPosted: Fri Apr 10, 2020 4:36 pm
by Taavi
Hello,
at the moment samples/ads.prg throws an error:

Error: Unknown or unregistered symbol
operation: ADSSETSERVERTYPE
called from: HB_HRBLOAD, line: 0
called from: ../apache.prg, EXECUTE, line: 143

on both mod_harbour and our testserver. Can we do something about it?
Is ADS remote server supported?

Thanks,
Taavi.

Re: mod_harbour and ADS server

PostPosted: Wed Apr 15, 2020 6:20 pm
by Taavi
Hi,
Just wanted to say that with some help from Antonio ADS remote server is working smoothly with mod_harbour now.

Just put ADS dll-s (and ads.ini if needed) in Apache/bin and verify if ADS dll-s are 64-bit for 64-bit Apache (or use 32-bit Apache for 32-bit ADS dll-s).

Thanks, Antonio.

Re: mod_harbour and ADS server

PostPosted: Thu Apr 16, 2020 7:45 am
by Antonio Linares
Glad to know that mod_harbour is working fine as expected.

Harbour for the web power! :-)

Re: mod_harbour and ADS server

PostPosted: Thu May 28, 2020 5:34 pm
by VitalJavier
Taavi
Podrias decirme cuales dll fueron los que pasaste

Gracias.

Re: mod_harbour and ADS server

PostPosted: Thu May 28, 2020 7:35 pm
by Antonio Linares

Re: mod_harbour and ADS server

PostPosted: Mon Jun 15, 2020 2:55 am
by Patricio Avalos Aguirre
Hola

he bajado el archivo y he pegado los dll en C:\xampp\apache\bin

ace64.dll
ace64.lib
axcws64.dll
Ads.ini

pero aun recibo el error

Error: Unknown or unregistered symbol
operation: ADSSETSERVERTYPE
called from: HB_HRBLOAD, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 70

Source:

Re: mod_harbour and ADS server

PostPosted: Mon Jun 15, 2020 3:57 am
by Antonio Linares

Re: mod_harbour and ADS server

PostPosted: Mon Jun 15, 2020 4:44 am
by Patricio Avalos Aguirre
gracias Antonio funciono!!!

para que funcione lo que hice fue esto

copiar los archivos en C:\xampp\apache\bin
ace64.dll
ace64.lib
axcws64.dll
adsloc64.dll
Ads.ini


ejemplo
Code: Select all  Expand view
function Main()

   ? RddRegister( "ADS", 1 )
   ? AdsSetServerType( 1 ) // ADS_LOCAL_SERVER )
   ? RDDSetDefault( "ADS" )
   ? RddSetDefault()

   /*
   DbCreate( hb_GetEnv( "PRGPATH" ) + "/data/test.dbf",;
             { { "FIRST", "C", 30, 0 },;
               { "LAST",  "C", 30, 0 } } )
   */


   USE ( hb_GetEnv( "PRGPATH" ) + "/data/menus.dbf" ) VIA "ADS"

   ? FieldName( 1 )
   ? FieldGet( 1 )
   ? RecCount()

   USE

return nil
 


resultado
Code: Select all  Expand view
NIL
0
DBFNTX
ADS
GLYPH
test
3

Re: mod_harbour and ADS server

PostPosted: Mon Jun 15, 2020 5:08 am
by Patricio Avalos Aguirre
También funciona con diccionario de datos, instale en una maquina virtual con ads server

Code: Select all  Expand view
function Main()
    local hConnection, aIndex, cDbf, i

   RddRegister( "ADS", 1 )
    rddsetdefault( "ADS" )
    AdsSetFileType( 2 )
   AdsSetServerType( 2 ) // ADS_REMOTE_SERVER )
    AdsLocking( .t. )
    AdsRightsCheck( .f. )

    if AdsConnect60( "\\VM-VIRTUAL\SISTEMA\DATOS\WINFACTU.ADD", 2, "adssys", "pass",, @hConnection )
        aIndex := AdsDirectory()
        for i := 1 to len( aIndex )
            cDbf := Left( aIndex[i], len( aIndex[i] )-1 )
            ? cDbf
        next i
    else
        ? 'error al conectarse a la base de datos'
    endif

    AdsDisconnect(hConnection)

return nil
 

resultado

Code: Select all  Expand view
BODEGA
DOCU_BF
DBTODOS
CTACTE
DOCU_COD
DOCU_COT
DOCU_DPR
DOCU_FPP
DOCU_FP
CLIENTES
DOCU_ENT
ARTICU
DOCU_OC



archivo ads.ini
Code: Select all  Expand view
[SETTINGS]

RETRY_ADS_CONNECTS = 1
DEFAULT_PROTOCOL=1
MTIER_LOCAL_CONNECTIONS=1

[VM-VIRTUAL]
LAN_IP=192.168.0.110
LAN_PORT=6262


espero que les sea de utilidad

Re: mod_harbour and ADS server

PostPosted: Mon Jun 15, 2020 6:27 am
by Antonio Linares
Muy bien!