I have a form where the ontimer event triggers a communication with an external device, opening a WinSock connection. (I think!) The device has its own IP address and uses TCP.
I the use the Declare Sub xxxx Lib ‘xxx’ etc. to declare any subs or functions I need to open/close connections and communicate with the device.
The program flow is:
Open Device
Connect device
Read or write to the device
Disconnect Device
Close Device
Although everything works as it should, when I’m done and I close the form or even sometimes when I close the database, it crashes and I get the ‘Microsoft Office Access has encountered a problem and needs to close.’ Dialog box. Then it makes a backup of the database and re-opens it.
I made new copies of the DB in case it became corrupt or something, but it still happens after every time I run the code.
I think the exception may have something to do with failure to write to the memory or something.
Is there some code I can use to 'clear up' anything that's still hanging around in memory, maybe in the forms unload event?
Sorry if this is too specific a question, I am not really a programmer (no... really! ) Like most I tend to find example code of what I need and then copy & paste and see how it works!
Any guidance would be appreciated.
TIA
Red
I the use the Declare Sub xxxx Lib ‘xxx’ etc. to declare any subs or functions I need to open/close connections and communicate with the device.
The program flow is:
Open Device
Connect device
Read or write to the device
Disconnect Device
Close Device
Although everything works as it should, when I’m done and I close the form or even sometimes when I close the database, it crashes and I get the ‘Microsoft Office Access has encountered a problem and needs to close.’ Dialog box. Then it makes a backup of the database and re-opens it.
I made new copies of the DB in case it became corrupt or something, but it still happens after every time I run the code.
I think the exception may have something to do with failure to write to the memory or something.
Is there some code I can use to 'clear up' anything that's still hanging around in memory, maybe in the forms unload event?
Sorry if this is too specific a question, I am not really a programmer (no... really! ) Like most I tend to find example code of what I need and then copy & paste and see how it works!
Any guidance would be appreciated.
TIA
Red