Hello,
has someone compile php with --enable-dbase option.
Best regards
Otto
#include "ads.ch"
#include "fivewin.ch"
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 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(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
Marcelo Via Giglio wrote:Otto, you can use ADS, and you can use many options to do a serious web interface, PHP, Perl, Python, etc, and the best, SQL with your DBFs
Lailton wrote:Otto,
You can to use Harbour + DBFCDX without needed extern application with CGI.
Contact me on skype and I can show you the power Harbour for Web!
I have a full application using a lot of DBFCDX working perfect with my FiveWeb!
reinaldocrespo wrote:Hello Carlos/Everyone;
Advantage has focused more on oData and Json with Advantage web api service they introduced with version 11. So you can use any web development platform and still be able to access .dbf data all the same via Json or oData. Having said that, Advantage does have a PHP extension for Linux and windows so you can use pure PHP to connect and access your data any time.
Here is a link that shows how to access dbf/cdx data under Advantage using open protocol oData:
http://jdmullin.blogspot.com/2010/09/advantage-web-api.html
Keep in mind Advantage is fully ISAM as well as SQL. Most web development languages are only SQL. What I'm trying to say is that you will probably have to learn some SQL in order to access your dbfs/cdxs across the web using PHP with Advantage but that limitation is imposed by the web developing language and not Advantage. Advantage speaks both just the same. With time, you realize SQL is better structured to access remote data, but I digress.
Here is a link to a complete non-oData PHP system accessing Advantage data (dbfs/cdxs) :
http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?devguide_accessing_advantage_using_the_advantage_php_extension.htm
I have a couple PHP portals accessing Advantage data across the internet where the web server is in one continent and the Advantage data (ADTs and DBFs) server is on another. It works great. The beauty is you can have FW-Win32 apps writing/reading/ reporting on the same data you also have PHP web portals doing the same on the same data. Likewise, the remote client doesn't have to be a browser, it could be an Android tablet pulling oData via the Advantage Web API.
I know all this sounds confusing. If paying for the server software is an option, then I would explore Advantage one step at a time. Eventually it all makes sense. Keep in mind that Advantage has free 2 user licenses of the server where you can write and test.
Hope that helps,
Reinaldo.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 115 guests