Home > Archive > MS Access and Internet > December 2005 > FTP-Connection through WinInet-API









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author FTP-Connection through WinInet-API
Wolfgang Marx

2005-12-11, 1:24 pm

OS: WinXP
Access: 2K
VBA

Hello everybody,
I'm wondering how to use a currently existing (wich mean's I'm already
ONLINE) Internet-Connection for FTP-Filetransfer.

Background:
Currently i'm using some API-Functions to create the Internet-Connection: (I
found all the Sources in the "API-Viewer", Provided by AllApi.net)
InternetOpen() - to create a Handle for the Connection to be Created
internetOpenURL() - to Read Files from the Server
This works fine, no matter if i'm using an existing RAS/MODEM Connection or
a Connection via Network-ProxyServer.
But I'm in need to use a little FTP-Filetransfer since i've been forced to
write some files to the WEBServer.

For this i am trying the following:
hOpen=InternetOpen()
- to create a Handle for the Connection to be created
hConnection= internetConnection()
- to create the Handle for the
FTP-Session:
like this:
InternetConnect(hOpe
n, "your ftp server", INTERNET_DEFAULT_FTP
_PORT, "your _
login", "your password", INTERNET_SERVICE_FTP
, IIf(PassiveConnectio
n, _
INTERNET_FLAG_PASSIV
E, 0), 0)

The Problem: I'm successful with this as long that I use an existing
RAS/MODEM-Connection on the System wich i'm running the App.
but when i try to use the Network Concection via ProxyServer,
internetConnection()
returns "0". this happens, no matter if a Connection
to the Internet already is established (by RAS/MODEM) or not. It seems that
all the parameters for the FTP-Login are Correct, because I get success when
i go online direkt by RAS-Connection. in this case InternetConnection()

returns a Value <> 0

This behavior is not similar to the internetOpenURL function, wich is in all
cases is Successful. Why?
Can Someone Help with some Tipps, Hint's or Samples?

Thanks in Advance
Wolfgang



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com