downloading file with FTP (1 Viewer)

ronstar

Registered User.
Local time
Today, 09:56
Joined
Sep 1, 2011
Messages
23
Hi all,

Below is the code I am using to download a file from an FTP server. When "Set FTP = New Inet" is executed I get error:

runtime error 429

ActiveX component can't create object

(p.s. I checked hte Microsoft Internet Transfer Control 6.0 (SP6) in the references, after installing msinet in SysWOW64, and registering in the cmd.exe by typing "regsvr32 msinet.ocx". I got a confirmatin that the file was registered, and can see it in the references.)

Can someone please advise why I am getting this error.

thank you kindly
Ron

Function DownloadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal RemoteFileName As String, _
ByVal LocalFileName As String) As Boolean

Dim FTP As Inet

Set FTP = New Inet
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Get " + RemoteFileName + " " + LocalFileName
Do While .StillExecuting
DoEvents
Loop
DownloadFile = (.ResponseCode = 0)
End With
Set FTP = Nothing
End Function
 

NigelShaw

Registered User.
Local time
Today, 08:56
Joined
Jan 11, 2008
Messages
1,573
Hi

The MSINET.OCX is a licenced ActiveX. If you dont have a licence on the machine, you cannot create the oblject. You can register the OCX but not use it unless you have a licence in place.

See if it native to Visual Studio Express? if it is, download it as its free from MS. The same this happened with me & Flexgrid. I could register it but not create an object. VS Express includes various OCX files that you cant use on their own.

It does fool you though as you may have tried a s'sample' db and it worked fine. This would be the case because the original was created with a licence.

Its all about the licence mate




Cheers


nidge
 

spikepl

Eledittingent Beliped
Local time
Today, 09:56
Joined
Nov 3, 2010
Messages
6,142
Licensing may or may not be an issue.

If you google your issue then there is a number of examples out there, that differ slightly from your code, eg., http://support.microsoft.com/kb/163653
 

ronstar

Registered User.
Local time
Today, 09:56
Joined
Sep 1, 2011
Messages
23
Apparently the server is an SFTP server, so I need different code. I have been looking but it seems that one always has to buy code/packages.

Can anyone please provide sample code.

thank you
 
Last edited:

Users who are viewing this thread

Top Bottom