Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP/wininet.dll cannot connect anonymous

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hello,

I have a routine I wrote using the wininet.dll to connect to FTP and download/upload files, this works fine!

However, I am trying to connect to one of our partner sites as anonymous and it will not work.

I have tried via I.E. , it connects fine, I have used the command FTP and connected fine that way also, I have even connected fine via FileZilla, however the VBA code will not work. WHY ? here is the code, when I show last server response it is saying
331 - password required for anonymous
?

Code:
hOpen = InternetOpen("FTP", 1, "", vbNullString, 0)
' Connect to FTP
hConnection = InternetConnect(hOpen, HostName, INTERNET_DEFAULT_FTP_PORT, UserName, Password, INTERNET_SERVICE_FTP, IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)

i am passing Username=anonymous and Password = IEUser@, so why am I having so much problems? I use the exact same code to connect to our own FTP sites that require usernames and passwords and everything is fine, so why is this giving me so much jip?





"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
It's ok, worked it out :)

I'd made a typo and transposed 2 numbers in the IP address which was held in a constant, declared at the top of the module!

No wonder I couldn't see anything wrong with my code!

Don't know who's server I was trying to connect to, but who's ever it was, please accept my appologies - lol

Regards,
1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top