Access Crashes on Winsock Usage

  • Thread starter Thread starter Kronzucker
  • Start date Start date
K

Kronzucker

Guest
Hi!

I'm Using Winsock on my Access 2000 Program.

1. TCP-Connection is ok
2. SendData is a HTTP-Request - Sending is OK
3. Event "DataArrival" reacts - Receives Data.

When the Datatransmission is over the connection is closed and after closing the tcp-connection, it seems as if access is in an endless loop - I can't stop the code and everything except access is working.

HOW CAN THAT BE?

Please help me.

Georg Fleischer
 
Thanks for your help, but after 4 hours of searching I found the mistake in my own code.

In Visual Bais the Winsock control closes connection after all of the data is received.
In VBA the Winsock control activates the Winsock_Close Event.

Winsock control is an ActiveXControl, so I don't see the object and events, that I can use. I found this event in VB.

I imported the Event and then I saw, that the application hangs in this event. The event is activated and after the sub is run through, the event sub is called again. I don't know, why the event is raised again and again, because normally an event is raised and after the sub is at it's end, the event is false.
But in this case, the event was raised over and over again.

Solution:
I put a WinsockCTRL.Close in the code of the winsockCTRL_Close() EVent. And then it worked.

Crazy, ain't it?

Thanks for your Interesst.
Hope, this article helps other desperate Access Programmers.

Georg
 
Can you give my code how you use winsock in Access?
 

Users who are viewing this thread

Back
Top Bottom