I had a similar project years ago - my projecthad to log-in (user id and pw). I used the ITC - but if I were to do it again I would use Michel Fournier's DLL solution (UT mag 2001).
I looked at my code - since my project was logged to the server - I did not use the "cPath" argument, just the file name (it's the "value" of a selected ListBox item). Here is my code - it was not inside an error loop - it just ran, "in line" without expecting an error:
exe_str=[,"DELETE ]+alltrim(thisform.RemoteDIR.Value)+["]
ThisForm.IC.Execute(&exe_str)
do while thisform.IC.StillExecuting
enddo
I used that object - but never to delete a "server"
>Hi All
>
>I'm using MSINET.OCX (Microsoft Internet Transfer Control) for interacting with a private FTP site (uploading, downloading & deleting). All is fine, but at the time of deleting a file from site, sometimes it does not get deleted and the form has gone in an endless loop.
>
>The code for deletion of file from FTP site is hereunder:
>
>
> WITH .oleFTP
> .RemoteHost = cFTPSite
> .Protocol = 2
> .UserName = cUserName
> .Password = cPassword
> > cOldError = ON("ERROR")
> ON ERROR frmFtpXfer.ErrorMethod()
>
> .Execute(, [SIZE ]+ cFtpPath + cFileName )
> DO WHILE .StillExecuting
> ENDDO
>
> nSize = VAL( .GetChunk( 1024 ) )
> IF nSize > 0
> .Execute(, [DELETE ]+ cFtpPath + cFileName )
> ELSE
> Thisform.nStateNo = 0
> ENDIF
>
> ON ERROR &cOldError
> ENDWITH
>
>
>
>Please help me to find a way out of this problem.
>There is 50-50 chance of deletion of the file.
Imagination is more important than knowledge