Solved

Running DOS FTP from VB 6.0

Posted on 2000-02-23
5
306 Views
Last Modified: 2011-10-03
I have a VB program that uses DOS FTP to send/receive files.  My question is can I error trap so if the FTP process did not work, I can display an error message? Here is what I am currently doing:
dReturnValue = Shell("C:\Windows\FTP.exe -i -s:c:\FTPscr2.txt", vbMaximizedFocus)
The return value is not a consistent number so I can't use it in an If/Else statement.  It's value is around -330091 to -401225 without any consistency.  Any Ideas?
0
Comment
Question by:grnavarro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:lmcneal
ID: 2552702
Is there a specific reason that you are using DOS FTP?

You should be able to make a reference to Microsoft Internet Transfer Control (msinet.ocx), instantiate that and then you can do it all from with in the VB environment.

This reference will aloow you to both FTP and HTTP

Lyle
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 100 total points
ID: 2552821
In your code dReturnValue is the process ID.  If you want to retrieve the return value from ftp.exe use GetExitCodeProcess()

ex:

"HOWTO: 32-Bit App Can Determine When a Shelled Process Ends"

http://support.microsoft.com/support/kb/articles/Q129/7/96.asp
0
 
LVL 20

Expert Comment

by:hes
ID: 2553160
You should think about using a ocx like the mabry ftp.
http://ww.mabry.com
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2606288
grnavarro?
Are you there?
0
 

Author Comment

by:grnavarro
ID: 2608027
I'm here.  I was just hoping some more comments/answers would come in.  The GetExitCodeProcess() was a viable solution.
Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question