Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    10

    Unanswered: using FTP from MS Access using msinet.ocx

    I would like to retrieve some data from an FTP server., and I would like to build a form in acces to do so. I have been advised to use the following function


    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

    Ive registed the msinet.ocx active x control but when I run the code I get the error message "run-time error 429 active x control cant create object" The problems eems to be with the first line of code:

    "Set FTP = New Inet" , but I have no idea what the problem is. Id be really grateful for some advice on this !!

  2. #2
    Join Date
    Feb 2004
    Posts
    199
    in all versions of windows there is an wininet.dll (by the way msinet uses this dll) and I use it directly via API. Information about it is in MSDN.
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •