Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FTP tables (Access XP- VBA)

    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,

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: FTP tables (Access XP- VBA)

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

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP tables (Access XP- VBA)

    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

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: FTP tables (Access XP- VBA)

    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?

  5. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP tables (Access XP- VBA)

    Have a look at http://officerone.tripod.com/vba/ftp_upload_file.html It may get you what you need, but it uses the msinet.ocx control.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  6. #6
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP tables (Access XP- VBA)

    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?

  7. #7
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP tables (Access XP- VBA)

    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.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

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