• FTP tables (Access XP- VBA)

    • This topic has 6 replies, 5 voices, and was last updated 22 years ago.
    Author
    Topic
    #388197

    I have an application where I produce two tables of data. Currently we export the tables as comma delimited text files and then open an FTP program to send the files to our remote location where they are used for website updates. I would like to put a command button on a form that does these steps in the background. I can export the files to the .txt files but how would I FTP these to the remote location? Is there a version of DoCmd.TransferDatabase that can open an FTP session?

    Thanks,

    Viewing 3 reply threads
    Author
    Replies
    • #680580

      You could use Shell to execute a batch file with the appropriate instruction(s).

    • #680634

      Try using the Shell command. First, create a text file containing all your FTP commands. Then, let’s assume the name of that text file is FTPPARMS and exists in C:TEMP, do something like this:

      dim retval as integer
      retval = Shell(“FTP -s:C:TEMPFTPPARMS.TXT 999.99.99.9”, 1) Change 999.99.99.9 to the IP address of your remote location

    • #680645

      I noticed in Tools>Reference… that I have an MSIEFTP 1.0 Type Library (msieftp.dll) which has logon methods, but no file transfer method. I wonder what it’s for?? Maybe it has a companion library that does the heavy lifting?

    • #680686

      Have a look at http://officerone.tripod.com/vba/ftp_upload_file.html%5B/url%5D It may get you what you need, but it uses the msinet.ocx control.

      • #680741

        Thank you for your help. I have built in a function based on the code you referenced. I can tell it is opening our remote location. I am having the button on the form export the tables as text files and referencing the text file names for the function. Do I need the entire path name of the text files or is the current path assumed?

        • #680748

          Never having built anything like that, I can only suggest that a safe bet is to use a full path and filename.

          Different apps may hold different “current directories” . Heck some apps even hold different current directories depending on what you are doing.

          So my recommendation is to use the full path, that way there is no “confusion” for the app.

    Viewing 3 reply threads
    Reply To: FTP tables (Access XP- VBA)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: