VB - FTP trouble

Sharky Forums


Results 1 to 3 of 3

Thread: VB - FTP trouble

  1. #1
    Catfish
    Join Date
    Feb 2001
    Location
    Cal
    Posts
    101

    Angry VB - FTP trouble

    I'm using Internet Transfer Control and I'm trying to have it execute 2 different commands but it keeps giving me an error saying "Still executing last request". I'm trying to delete an old file and then send a new one right after that. Here is my code (with some things removed for privacy):

    Inet1.Execute "ftp://USERNAME:[email protected]", "DELETE data.txt"
    Inet1.Execute "ftp://USERNAME:[email protected]", "PUT C:\new\data.txt data.txt"

    If I break right after the first statement and wait about 1 second, I can step through the second one and it will execute without error. Is there a command that'll just tell it to pause execution for about 2 seconds so the other request has time to complete?


    ------------------
    "Why do they call it "common" sense, if so many people are lacking it?"

    "....hey welcome to the real world where things don't go they way you wish they would." - Thanks for that one CajnDave
    "Why do they call it "common" sense, if so many people are lacking it?"

    "....hey welcome to the real world where things don't go they way you wish they would."

  2. #2
    Hammerhead Shark hobbes2112's Avatar
    Join Date
    Jul 2001
    Posts
    1,553

    Post

    just have the first, start a timer, and the second trigger off that timer after a preset time

    ------------------
    May we never see an old friend
    With a new face.

  3. #3
    Catfish
    Join Date
    Feb 2001
    Location
    Cal
    Posts
    101

    Post

    Originally posted by hobbes2112:
    just have the first, start a timer, and the second trigger off that timer after a preset time

    ....Oh boy.... I'm a little slow aren't I? Thank you


    Inet1.Execute "ftp://USERNAME:[email protected]", "DELETE data.txt"
    Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Timer()
    Timer1.Interval = 3000
    Inet1.Execute "ftp://USERNAME:[email protected]", "PUT C:\new\data.txt data.txt"
    Timer1.Enabled = False
    End Sub



    ------------------
    "Why do they call it "common" sense, if so many people are lacking it?"

    "....hey welcome to the real world where things don't go they way you wish they would." - Thanks for that one CajnDave
    "Why do they call it "common" sense, if so many people are lacking it?"

    "....hey welcome to the real world where things don't go they way you wish they would."

Posting Permissions

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