Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2006

Tip: Looking for answers? Try searching our database.

Capture FTP events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 16 Feb 2006 14:55 GMT
I am passing a script to ftp.exe (using Shell) to do these actions:

1. Dir the FTP folder, redirecting the Dir output to a text file
I then import the text file into a table and examine the contents to
determine if the correct files are available)
2. Download the files if available

Using the value returned by the API's WaitForSingleObject, I can even
determine whether the FTP connection timed out (either downloading a very
large file, or the process simply hung), and using KillTask, I can kill FTP
if so.

There are two things I cannot tell, however, because they are internal to
ftp.exe.

1. Incorrect FTP server name.
2. Incorrect FTP user name and/or password

Both of these generate FTP return codes. I know I can test this manually,
but I would really like to determine this error at runtime in Access for
diagnostic purposes. As it stands, I have no way of distinguishing between an
incorrect username/password and a Dir that is legitimately empty because
there are no files on the FTP server; both result in normal termination of
FTP and an empty file list.

Is there a way to direct the output of the FTP session into a text file so
that I can examine the contents for potential FTP errors?
Dirk Goldgar - 16 Feb 2006 16:43 GMT
> I am passing a script to ftp.exe (using Shell) to do these actions:
>
[quoted text clipped - 23 lines]
> Is there a way to direct the output of the FTP session into a text
> file so that I can examine the contents for potential FTP errors?

There are class libraries available that would be more flexible.
However, to follow the approach you've been using, I believe you could
shell to the command interpreter to execute ftp.exe, and use redirection
switches to capture both the stdout and stderr output streams.  Like
this, which seemed to work in a quick test:

   shell "cmd /c ftp.exe -s:\temp\ftpscript.txt >\temp\ftpout.txt 2>&1"

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.