Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003

    Unanswered: Move file to FTP site!!!Help

    i have the backend of my database currently (where my data is) stored on my machine under (c:\database\data.mdb), and the front end on my desktop. instead of the back end being stored on my local machine, i want to move it to and from my ftp site. why you ask.... because when i open the front end of my database (stored on my desktop) i want it to retreive the backend database file "Data.mdb" from the ftp site and put it in the directory "c:\database\". then when i exit the database i want it to move (not copy) the file "data.mdb" back to the ftp site.

    all i need is a little help with the code....

    i am new to VB. but have written procedures in access for copying files from one location to another, but dont now how to move file to and from an ftp site.

    please help....

    cheers lee

  2. #2
    Join Date
    Nov 2003
    Warren, PA
    I feel you will have a lot of problems with data Integrity but here is the code to do it this code is to download it. Just change for uploading

    on open code
    Open FilePath & "GetFile.txt" For Output As #1 ' Create a script to get the Netwash file to the current directory
    Print #1, "ftpIPAddress"
    Print #1, "Username"
    Print #1, "Password"
    Print #1, "cd dirname"
    Print #1, "cd additional Dirnames only if needed"
    Print #1, "get filename ""full path and file name to save EX C:\mydb.mdb"""
    Print #1, "quit"
    Close #1

    Call modulename("cmd /c ftp -s:""" & FilePath & "GetFile.txt""", vbNormalFocus)

    Module Code

    Dim Start As STARTUPINFO
    Dim ret&

    ' Initialize the STARTUPINFO structure:
    Start.cb = Len(Start)
    Start.dwFlags = 1
    Start.wShowWindow = iWindowStyle

    ' Start the shelled application:
    ret& = CreateProcessA(vbNullString, cmdline$, 0&, 0&, 1&, _
    NORMAL_PRIORITY_CLASS, 0&, vbNullString, Start, proc)

    ' Wait for the shelled application to finish:
    ret& = WaitForSingleObject(proc.hProcess, INFINITE)
    Call GetExitCodeProcess(proc.hProcess, ret&)
    Call CloseHandle(proc.hThread)
    Call CloseHandle(proc.hProcess)
    ExecCmd = ret&


    See if this helps
    Last edited by bhummel; 12-04-03 at 13:19.

  3. #3
    Join Date
    Dec 2003


    thanks for your time.... but am new to programing and im not sure what to do with this.

    i have put the code into the database. what do i need to do next. i have entered my details (ftp,user,pass etc) what is the getfile.txt. do i need to make this.

    im sorry, but as i said earlier, im a newbie.

    cheers lee.

  4. #4
    Join Date
    Nov 2003
    Warren, PA
    Once it is in the database all you need to do is run the code and it will create those files for you. Give it a try and let me know what happens and I will assist you through it


Posting Permissions

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