I have a server program written in Java which is listening on a specific TCP port. And I have a client program written with Microsoft Access/VBA which uses the Winsock ActiveX control (MSWINSCK.OCX, Version 6.1.98.17) to communicate with the server program. Both programs are written by myself.
Everything works well ... as long as the client and server programs run on different machines.
If both programs reside on the same machine the client program gets the error code 10061 "Connection is forcefully rejected" when trying to connect to the server which I have started before.

I use two computers, one with Windows XP and Access 2003 (also Access 2000 present), and the other with Windows 7 (32 bit) with Access 2010.
The problem occurs on both computers. I verified that when the problem occurs I can nevertheless connect to the server from the other computer (So everything seems to be correct with the server).
The use of Access 2000 instead of Access 2003 on the XP machine does not make any difference. Also the use of "localhost" or "127.0.0.1" as target host does not make a difference.

In case of the successful operation the server may reside on the Windows 7 machine and the client on the XP machine, or vice versa.

Any suggestions what's going wrong?