Click to See Complete Forum and Search --> : VB - FTP trouble


Insylum
09-28-2001, 09:39 PM
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:PASSWORD@207.207.207.207", "DELETE data.txt"
Inet1.Execute "ftp://USERNAME:PASSWORD@207.207.207.207", "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

hobbes2112
09-29-2001, 01:40 AM
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.

Insylum
10-01-2001, 08:14 PM
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:PASSWORD@207.207.207.207", "DELETE data.txt"
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Timer1.Interval = 3000
Inet1.Execute "ftp://USERNAME:PASSWORD@207.207.207.207", "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