求助!!,经常出现错误,请高手帮忙
有一个小程序,是用FTP方式到IP地址为129.56.140.40的电脑上的aaa目录下(密码为010e)接收三个文件,文件不是每天都有的运行时有时可用,但很多时候都出错,错误是:运行时错误: '-2147417848(80010108)':Automation错误
代码如下,请那位高手帮忙看一下,是错在那儿
Private Sub Command1_Click()
Dim Dat1, Dat2, mdate, Firstdat, Firstend
Dat1 = Text1.Text
Dat2 = Text2.Text
Firstdat = DateAdd("d", -1, Dat1) '日期格式
aaa = DateAdd("d", -1, Dat2)
Firstend = DateAdd("d", 1, aaa)
While Not (Firstdat = Firstend)
mdate = DateAdd("d", 1, Firstdat)
Firstdat = mdate
indate = Format(Firstdat, "yyyymmdd")
Inet1.Execute "FTP://aaa:010e@129.56.140.40", _
"GET " & indate & "_123-01.zip C:\aaa\" & indate & "_123-01.zip", "QUIT"
right1 = Inet1.StillExecuting
Do While right1
right1 = Inet1.StillExecuting
DoEvents
Loop
Inet1.Execute "FTP://aaa:010e@129.56.140.40", _
"GET " & indate & "_123-02.zip C:\aaa\" & indate & "_123-02.zip", "QUIT"
right2 = Inet1.StillExecuting
Do While right2
right2 = Inet1.StillExecuting
DoEvents
Loop
Inet1.Execute "FTP://aaa:010e@129.56.140.40", _
"GET 001_" & indate & "_001_456.zip C:\aaa\报表数据\001\001_" & indate & "_001_456.zip", "QUIT"
right3 = Inet1.StillExecuting
Do While right3
right3 = Inet1.StillExecuting
DoEvents
Loop
Wend
MsgBox "接收完毕"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub