Per EMg

Moderator: Enrico Maria Giordano

Per EMg

Postby Silvio » Fri Feb 08, 2008 4:17 pm

potrei usare adordd per visualizzare e/o modificare un file ACCESS posto in un determinato sito web ?

Hai un test minimale ?

l'archivio è ECom.mdb ed è posto in www.bpascal.it/mdb-database

e alcune tabelle sono :

Prodotti
Categorie
Scategorie
Utenti
OrdiniProdotti
ecc.

grazie
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Per EMg

Postby Enrico Maria Giordano » Fri Feb 08, 2008 5:18 pm

No, non puoi accedere ad un database dal di fuori del server, quindi solo con uno script residente sul server stesso. A meno che il database non sia stato reso esplicitamente accessibile dall'esterno, ma non so se questo è possibile con un MDB. In ogni caso il tuo non lo è:

HTTP Error 403.2 - Forbidden: Read access is denied.


E poi c'è un altro consiglio: ADORDD a me sembra attualmente un progetto lasciato a metà. Non credo sia il caso di utilizzarlo seriamente.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Fri Feb 08, 2008 5:51 pm

io ho lo necessita di aprire/modificare /inserire/stampare dati che sono in

un archivio MDB ( lo posso mettere anche dentro ad un cartella nel pc

e lo devo fare da un programma FwH

Lo devo prima salvare sul pc attraverso la classe ftp e non so come si fa
poi ci debbo lavorare ( inserire modificare e stampare)

l'importante che a fine lavoro io lo posso automaticmente inserire dentro

a quella cartella magari con ftp class ...


E' possibile farlo oppure ci debbo rinunciare ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Enrico Maria Giordano » Fri Feb 08, 2008 6:08 pm

Sì, questo è possibilissimo. Queste sono le funzioni e un esempio per l'FTP:

Code: Select all  Expand view  RUN
#include "Fivewin.ch"


//
// File attributes
//

#define FILE_ATTRIBUTE_READONLY  1
#define FILE_ATTRIBUTE_HIDDEN    2
#define FILE_ATTRIBUTE_SYSTEM    4
#define FILE_ATTRIBUTE_DIRECTORY 16
#define FILE_ATTRIBUTE_ARCHIVE   32
#define FILE_ATTRIBUTE_NORMAL    128
#define FILE_ATTRIBUTE_TEMPORARY 256


//
// access types for InternetOpen()
//

#define INTERNET_OPEN_TYPE_PRECONFIG                    0   // use registry configuration
#define INTERNET_OPEN_TYPE_DIRECT                       1   // direct to net
#define INTERNET_OPEN_TYPE_PROXY                        3   // via named proxy
#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY  4   // prevent using java/script/INS


//
// manifests
//

#define INTERNET_INVALID_PORT_NUMBER    0           // use the protocol-specific default

#define INTERNET_DEFAULT_FTP_PORT       21          // default for FTP servers
#define INTERNET_DEFAULT_GOPHER_PORT    70          //    "     " gopher "
#define INTERNET_DEFAULT_HTTP_PORT      80          //    "     " HTTP   "
#define INTERNET_DEFAULT_HTTPS_PORT     443         //    "     " HTTPS  "
#define INTERNET_DEFAULT_SOCKS_PORT     1080        // default for SOCKS firewall servers.


//
// service types for InternetConnect()
//

#define INTERNET_SERVICE_FTP     1
#define INTERNET_SERVICE_GOPHER  2
#define INTERNET_SERVICE_HTTP    3


//
// flags for FTP
//

#define INTERNET_FLAG_TRANSFER_ASCII  1
#define INTERNET_FLAG_TRANSFER_BINARY 2


FUNCTION MAIN()

    LOCAL hInternet, hConnect

    hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )

    hConnect = INTERNETCONNECT( hInternet, "myftpaddress", INTERNET_INVALID_PORT_NUMBER, "myuserid", "mypassword", INTERNET_SERVICE_FTP, 0, 0 )

    ? FTPGETFILE( hConnect, "/emagsoftware.it/test/atest.prg", "atest.prg", 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 )

//    ? FTPPUTFILE( hConnect, "atest.prg", "/emagsoftware.it/test/atest.prg", 0, 0 )

    INTERNETCLOSEHANDLE( hConnect )

    INTERNETCLOSEHANDLE( hInternet )

    RETURN NIL


#pragma BEGINDUMP

#include "windows.h"
#include "wininet.h"
#include "hbapi.h"


HB_FUNC( INTERNETOPEN )
{
    hb_retnl( ( LONG ) InternetOpen( hb_parc( 1 ), hb_parnl( 2 ), hb_parc( 3 ), hb_parc( 4 ), hb_parnl( 5 ) ) );
}


HB_FUNC( INTERNETCLOSEHANDLE )
{
    hb_retl( InternetCloseHandle( ( HINTERNET ) hb_parnl( 1 ) ) );
}


HB_FUNC( INTERNETCONNECT )
{
    hb_retnl( ( LONG ) InternetConnect( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), ( INTERNET_PORT ) hb_parnl( 3 ), hb_parc( 4 ), hb_parc( 5 ), hb_parnl( 6 ), hb_parnl( 7 ), hb_parnl( 8 ) ) );
}


HB_FUNC( FTPGETFILE )
{
    hb_retl( FtpGetFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parl( 4 ), hb_parnl( 5 ), hb_parnl( 6 ), hb_parnl( 7 ) ) );
}


HB_FUNC( FTPPUTFILE )
{
    hb_retl( FtpPutFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ) );
}


HB_FUNC( FTPDELETEFILE )
{
    hb_retl( FtpDeleteFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}


HB_FUNC( FTPCREATEDIRECTORY )
{
    hb_retl( FtpCreateDirectory( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}


HB_FUNC( FTPREMOVEDIRECTORY )
{
    hb_retl( FtpRemoveDirectory( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}


HB_FUNC( FTPFINDFIRSTFILE )
{
    hb_retnl( ( LONG ) FtpFindFirstFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), ( WIN32_FIND_DATA * ) hb_parc( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ) );
}


HB_FUNC( INTERNETFINDNEXTFILE )
{
    hb_retl( InternetFindNextFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}

#pragma ENDDUMP


E per gestire l'MDB puoi utilizzare ADO. Di esempi per ADO ne ho messi tanti in giro.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Fri Feb 08, 2008 8:35 pm

bene allora mo faccio na ricerca..
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Sat Feb 09, 2008 12:18 am

ho fatto una prova ma ....

[1]:iLink32.Exe -Gn -aa -Tpe -s @test.bcl
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'InternetOpenA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'InternetCloseHandle' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'InternetConnectA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpGetFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpPutFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpDeleteFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpCreateDirectoryA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpRemoveDirectoryA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpFindFirstFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'InternetFindNextFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Sat Feb 09, 2008 12:21 am

hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )


cosa devo mettere al posto di Anystring ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Enrico Maria Giordano » Sat Feb 09, 2008 3:58 pm

Silvio wrote:ho fatto una prova ma ....

[1]:iLink32.Exe -Gn -aa -Tpe -s @test.bcl
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'InternetOpenA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'InternetCloseHandle' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'InternetConnectA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpGetFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpPutFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpDeleteFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpCreateDirectoryA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpRemoveDirectoryA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'FtpFindFirstFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ
Error: Unresolved external 'InternetFindNextFileA' referenced from C:\WORK\ERRORI\FTP\OBJ\TEST.OBJ


Devi linkare wininet.lib.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Sat Feb 09, 2008 3:58 pm

Silvio wrote:hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )


cosa devo mettere al posto di Anystring ?


Puoi tranquillamente lasciare Anystring.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Sat Feb 09, 2008 5:27 pm

where i can...scusami dove trovo la wininet.lib ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Enrico Maria Giordano » Sat Feb 09, 2008 5:32 pm

Silvio wrote:where i can...scusami dove trovo la wininet.lib ?


E' una delle librerie di BCC.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Sat Feb 09, 2008 5:37 pm

thanks
oops
grazie
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Sat Feb 09, 2008 5:39 pm

adesso mi si compile e quando gira mi viene un alert con il valore .f.
che cosa vuol dire ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Sat Feb 09, 2008 5:41 pm

io ho fatto in questo modo :

FUNCTION MAIN()

LOCAL hInternet, hConnect

hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )

hConnect = INTERNETCONNECT( hInternet, "ftp.bpascal.it", INTERNET_INVALID_PORT_NUMBER, "130603@aruba.it", "mypass", INTERNET_SERVICE_FTP, 0, 0 )

? FTPGETFILE( hConnect, "/bpascal.it./mdb-database/ecom.mdb", "ecom.mdb", 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 )

// ? FTPPUTFILE( hConnect, "atest.prg", "/emagsoftware.it/test/atest.prg", 0, 0 )

INTERNETCLOSEHANDLE( hConnect )

INTERNETCLOSEHANDLE( hInternet )

RETURN NIL


in mypass c'è la mia password che uso in ftp...
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Sat Feb 09, 2008 6:12 pm

ho controllato

posso entrare con explorer in ftp
e il file che mi serve di scaricare è

ftp://ftp.bpascal.it/bpascal.it/mdb-database/ecom.mdb

perchè non va con fwh ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Next

Return to All products support

Who is online

Users browsing this forum: No registered users and 20 guests

cron