WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

FTP Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FTP Session Not Opening with 999 Error on FTPOpen

Keywords:   FTPOpen

RE: FtpOpen Hangs

FtpOpen sometimes hangs. We have another extender, the WinInet Extender, which is a complete new replacement Internet extender. It seems to run a lot better, but of course is completely incompatible with existing code (although it should not be that difficult to change).

The best workaround it seems so far is simply to wxPing the ftp site right before the ftpOpen, to see if it responds to the ping before attempting the open. This greatly reduces the frequency of hanging.

A user also reported to us that they were having problems with FTPOpen hanging, but when they deleted Dial-up Networking and reinstalled Dial-up Networking, FTPOpen started working.

Special note on the 999 Error:

There is not a list of the error messages that correspond to the 999 FTP Winsock error because the informative messages for this error are passed by the server, rather than by the Winsock extender functions. Therefore, the exact syntax of the error message depends on the configuration of the server.

Question #1:

I get the error message "FTP Session Not Open" using the wwwsk321 extender function FTPGET. This only occurs on pc's connected to a certain server (and thus configured the same way by their lan administrator in terms of their tcp/ip settings, if this is any clue). What could be causing this? It doesn't occur on other pc's. Executing the Microsoft FTP program through Winbatch works ok, by the way.

When I pop the return code from FTPOPEN into a message box to look at it, I got a message from the FTPOPEN statement saying that there was a 999 error, server not found. For the Host, I had put the actual name of the host machine. When I substituted the IP address of the host, the error went away. I would rather use the host name of the machine in case the IP address changes (which I was informed may occur). What could be causing the problem? Is there some parameter that has to be changed in Win95?

Answer:

Theoretically it should work with the host name, but there are more steps involved. I assume you can connedt to the ftp fite with a normal FTP program using that host name?

Basically we get the host name, then ask windows to translate it into an IP address by asking your defined DNS server. If your DNS server is down - nogo. If you do not have a defined DNS server - nogo (but then your web browser and ftp would need ip addresses only too - I don;t think thsi is the case)

Possible typo in host name?

If you post the line of code with the host name in it instead of the IP address, we can look at it and check the DNS resolution information.

Question (thread continued):

Here's more detail to the situation: Using the host name works fine on every pc except for a few. All pc's are connected to different Novell servers on several LANs. Every pc is FTPing to one central Unix host. The pc's that are having a problem happen to be connected to the same Novell LAN and thus are managed by and set-up by the same LAN Administrator, and could therefore be configured the same way. Since the same compiled Winbatch code works fine using the Host name for most users, it couldn't be a typo. I think it may be the way their pc's or LAN are configured, but I am not sure where to look. Does this info give you any insight into what I should do next? Thanks for all your help :)

Answer:

It's a DNS Server problem. Assuming you are running Windows 95 compare the information obtained between working and non-working machines.
Control Panel
->Network Applet
->TCP/IP (possibly pointing to a network card)
->Properties
->DNS
See that IP address is configured for the DNS server and if DNS (or LMHOSTS) is enabled.

If DNS, locate DNS machine the bad PCs are pointing to and consult with administrator. DNS Tables need updating (Should be auotmatic but...).

If LMHOSTS, then the LMHOSTS file in your Windows (maybe \Windows\system) directory is out of date.

Question #1:

I'm doing a number of FTPOpen/FTPClose sessions to a given host, about 4-5x per hour, and every so often (unpredictably), I get the 999 error, Operation Aborted. Then every time I do an FTPOpen after that, I get the 999 error. If I stop and restart the script, the error goes away. Any ideas?

Answer:

No fix for you right now, but we do have a workaround:

Test for the 999 error with the Lasterror function:

retcode = FTPOpen(...)
if retcode == 0
	errcode=LastError()
	if errcode == 999 then run("Winbatch.exe", "myscript.wbt")
	
	; How to kill another WinBatch program
	hwnd = DllHwnd("The WinBatch window title")
	IntControl(23, hwnd, 1111, 1332, 0)


Article ID:   W12642
Filename:   999 Error on FTPOpen.txt
File Created: 1999:04:15:16:48:38
Last Updated: 1999:04:15:16:48:38