General discussion

  • Creator
    Topic
  • #2073892

    Access97 – Moving a text file from one d

    Locked

    by creed ·

    Please HELP! I have been asked to change my database to accomodate an ftp transfer, and I need to move that file from the ftproot directory on one drive to my Access97 database on another drive. Is there an easy way to do this in code? The file needs to reside in my Access97 database for the rest of the coding to work correctly. The move is the easiest way to accomplish this. It would delete the file from FTP and deposit it into my database where the rest of the code can manipulate it. I needthis asap, please help.

All Comments

  • Author
    Replies
    • #3785083

      Access97 – Moving a text file from one d

      by rraheb ·

      In reply to Access97 – Moving a text file from one d

      It is not clear from your question whether the FTP process itself would be done maually or would be done through your program. If the FTP will be done manually then you can copy the file using the shell command in a module in your access database.
      The “shell” command is used to invoke an external application (i.e. exe file). You can use the shell command to invoke the COPY command and give the copy command the source file path and the destination file path.

      e.g. shell (“c:\winnt\system32\copy.exe f:\source.txt f:\destination.txt”, vbMinimizedNoFocus)

      If you need to do the FTP through your program then you can use a scripting tool to do it for you or an automated FTP like cuteFTP then copy/move the file using the method described above.

      Hope this is useful for you.

      Regards,

      Rafik El-Raheb.

      • #3785022

        Access97 – Moving a text file from one d

        by creed ·

        In reply to Access97 – Moving a text file from one d

        Dear Rafik:
        Can you give me some sample code to move up to 9 files with the extention of txt from r:\ to s:\ using the above shell command? All nine files may not be transfered each time, but then again the ones transferred may be any combination of all 9 or just 1 or 2 files. I want to attach this to a button so this downloads automatically for the user. It is a txt file put on a network drive by the FTP method of transfer, I am not using FTP.

    • #3785043

      Access97 – Moving a text file from one d

      by volksjager ·

      In reply to Access97 – Moving a text file from one d

      I have done something similar using VBA. I used the import command in the code to take a CSV type file from a given directory and automatically import the file into an Access 97 database. If this is what you are trying to do, let me know and I can give you some example code.

Viewing 1 reply thread