#include "ads.ch"
#include "fivewin.ch"
#command SET FILETYPE TO <x:NTX,CDX,ADT> ;
=> AdsSetFileType( if( upper( <(x)> ) == "NTX", 1, ;
if( upper( <(x)> ) == "CDX", 2, 3 ) ) )
REQUEST ADS
REQUEST DBFFPT
function main()
LOCAL oDlg, consulta := SPACE(400), oLbx, path := " ",;
connect, tipo := "ADT"
RddRegister("ads",1)
RddSetDefault("Ads")
AdsSetServerType ( 1 ) // local
AdsSetFileType(3)
SET DELETED ON
adsRightsCheck( .F. )
DEFINE DIALOG oDlg RESOURCE "consulta"
REDEFINE COMBOBOX tipo ID 108 ITEMS {"NTX","CDX","ADT"} OF oDlg ;
ON CHANGE AdsSetFileType( IF( tipo == "NTX", 1, ;
IF( tipo == "CDX", 2, 3 ) ) )
REDEFINE GET path ID 102 OF oDlg
REDEFINE BUTTON ID 103 OF oDlg ACTION ( AdsDisconnect(AdsConnection()),;
IF ( AdsConnect60( path , 7,"ADSSYS"), ;
connect:setcolor(CLR_GREEN, CLR_GREEN),;
connect:setcolor(CLR_HRED, CLR_HRED ) ;
),;
connect:refresh() ;
)
REDEFINE SAY connect PROMPT " " ID 110 OF oDlg COLOR CLR_HRED, CLR_HRED
REDEFINE GET consulta ID 104 OF oDlg
REDEFINE BUTTON ID 106 OF oDlg ACTION resultado( consulta )
REDEFINE BUTTON ID 107 OF oDlg ACTION oDlg:end()
ACTIVATE DIALOG oDlg
//AdsDisconnect(AdsGetConnectionHandle())
AdsDisconnect(AdsConnection())
return nil
FUNCTION resultado( consulta )
LOCAL oDlg, oLbx,e
ADSCreateSQLStatement("SQLarea",2)
IF ADSExecuteSQLDirect( consulta )
TRY
DEFINE DIALOG oDlg RESOURCE "resultado"
REDEFINE LISTBOX oLbx FIELDS ALIAS "SQLarea" ID 101 OF oDlg
REDEFINE SAY PROMPT "RESULTADO : " + ALLTRIM( STR ( SQLarea -> ( LASTREC() ) ) ) ID 200 OF oDlg COLOR CLR_BLUE
REDEFINE BUTTON ID 102 OF oDlg ACTION oDlg:end()
REDEFINE BUTTON ID 103 OF oDlg ACTION oLbx:report()
ACTIVATE DIALOG oDlg
sqlarea -> ( DBCLOSEAREA() )
CATCH e
? "COMANDO EJECUTADO"
END
ELSE
MSGINFO("Error en la ejecución de la consulta")
sqlarea -> ( DBCLOSEAREA() )
ENDIF
RETURN NIL
Enrico Maria Giordano wrote:Boris,
unfortunately, there are serious problems with CGI EXE web applications: they won't run using default web server setting. So you probably can't run them in the customers web server. Another problem is that they require Windows, unless you compile your CGI EXE for other systems, can you?
EMG
Adolfo wrote:Codemaker
Excelent, but I have a question, Does it work only in Win Servers, can I use a Linux one ?
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 60 guests