Hi There,
When I download multiple files from FTP site using VB, I got this error message.
Run-time error 35764
Still executing last request.
Could someone please help?
Enclosed is the code.
Dim cn As ADODB.Connection 'connection object
Dim rs As ADODB.Recordset
Dim strPathtoDB As String 'path to database
Dim strCn As String 'string connection
Dim FileName As String
Dim tablename as string
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
DoEvents
If LCase$(Left$(HostName, 6)) <> "ftp://" Then HostName = "ftp://" & HostName
frmDownload.InetFTP.URL = HostName
frmDownload.InetFTP.UserName = UserName
frmDownload.InetFTP.Password = Password
strPathtoDB = App.path & "\Download.mdb" 'set the path to database
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & strPathtoDB
cn.Open strCn 'open database
rs.CursorLocation = adUseClient
rs.Open tablename, strCn, adOpenKeyset, adCmdTable
Do While Not rs.EOF = True
FileName = rs!FILE_NAME frmDownload.InetFTP.Execute , "Get " & FileName & " " & "C:\" & DatabaseName& "\" & FileName
rs.MoveNext
Loop
Closedown:
If Not cn.state = adStateClosed Then cn.Close 'close connection
If Not rs.state = adStateClosed Then rs.Close 'close recordset
Set cn = Nothing 'reclaim memory
Set rs = Nothing 'reclaim memory
When I download multiple files from FTP site using VB, I got this error message.
Run-time error 35764
Still executing last request.
Could someone please help?
Enclosed is the code.
Dim cn As ADODB.Connection 'connection object
Dim rs As ADODB.Recordset
Dim strPathtoDB As String 'path to database
Dim strCn As String 'string connection
Dim FileName As String
Dim tablename as string
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
DoEvents
If LCase$(Left$(HostName, 6)) <> "ftp://" Then HostName = "ftp://" & HostName
frmDownload.InetFTP.URL = HostName
frmDownload.InetFTP.UserName = UserName
frmDownload.InetFTP.Password = Password
strPathtoDB = App.path & "\Download.mdb" 'set the path to database
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & strPathtoDB
cn.Open strCn 'open database
rs.CursorLocation = adUseClient
rs.Open tablename, strCn, adOpenKeyset, adCmdTable
Do While Not rs.EOF = True
FileName = rs!FILE_NAME frmDownload.InetFTP.Execute , "Get " & FileName & " " & "C:\" & DatabaseName& "\" & FileName
rs.MoveNext
Loop
Closedown:
If Not cn.state = adStateClosed Then cn.Close 'close connection
If Not rs.state = adStateClosed Then rs.Close 'close recordset
Set cn = Nothing 'reclaim memory
Set rs = Nothing 'reclaim memory