Solved

Running DOS FTP from VB 6.0

Posted on 2000-02-23
5
299 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
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now