Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008

    Unanswered: FTP Hello World Please!

    I'm trying desperately to automate an FTP process. I have a site/user/pass and all of that is working. I have tested it at the cmd prompt.

    I've looked around and tried to run this since it was a simple 'hello world':

    But I had no luck

    I also downloaded and ran this. It's an exe that uses a text file to control the FTP process. I looked at the code but was unable to get it to work when I tried to copy and paste it in access.

    I was able to run the exe and modified the control file and had success retrieving a file, but it's a standalone program and I want to perform the FTP programatically.

    I don't want to run a batch file. I'm getting the impression that the visual basic supplied with access is not robust enough to allow me do to this.

    I've gone to ActiveX Controls in Access and chose "Register" for "Microsoft Internet Transfer Control 6.0 (SP4)" referencing msinet.ocx

    In the VB portion of Access, I've gone to "References" and made sure that "Microsoft Internet Transfer Control 6.0 (SP4)" is checked.

    What I can't see is an FTP Control that I can drag to a form and then reference that control to write a very simple 'hello world'.

    Can anyone show me a very simple example using the following credential set?

    user: anonymous
    GET /incoming/SYSFEED.TXT ; c:\SYSFEED.TXT

    This would grab a file from the FTP incoming directory and copy it to my local drive.

    For those interested, this is a pipe-delimited text file that is written to an FTP site every day that supports a bundle of reports.

  2. #2
    Join Date
    Jul 2004
    South Dakota
    I believe I have what you are looking for at the office...once I get in today I'll see what I can find and post it.


  3. #3
    Join Date
    Aug 2008
    great.. i'm doing a very clunky workaround. much appreciated

  4. #4
    Join Date
    Jul 2004
    South Dakota
    I think this is what you are looking for.

    Add clsFTP as a Class module to your database and then add WinInetAPI as a standard module. This code is by no means mine nor am I'm trying to pass it off as such. I have left the author's notes and names in the files just the way that I had found them.

    Below is some sample code to download a file from an FTP server. You'll need to replace the text in ALL CAPs with the appropriate values.

    Public Function RetrieveFile() As Boolean
        On Error GoTo ErrHandler
        Dim oFTP As New clsFTP
        Dim vItem As Variant
        Dim i As Integer
        Call oFTP.OpenConnection(SOME.FTP.SERVER, USER_NAME, PASSWORD, "")
        If oFTP.DownloadFile(FILE_TO_GET, DESTINATION_OF_FILE) Then
           Debug.Print "File Downloaded."
        End If
        RetrieveFile = True
        'Clean Up
        Set oFTP = Nothing
        Exit Function
        RetrieveFile = False
        Resume ExitHere
    End Function
    Attached Files Attached Files

Posting Permissions

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