Code causing crash (1 Viewer)

rede96

Registered User.
Local time
Today, 01:38
Joined
Apr 2, 2004
Messages
134
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
 

MStCyr

New member
Local time
Yesterday, 20:38
Joined
Sep 18, 2003
Messages
333
Hi

Is the app. running on a server or local?


The following suggestions may help you to diagnose the problem:

- If the workstation has a complete Microsoft Access installation, quit
and then restart Microsoft Access on the workstation, and see if it
operates correctly without using the network for any services. If the
problem continues with Microsoft Access operating in isolation, begin
checking the workstation for memory conflicts.

- If the database is being accessed off a network server, consider
copying it to the local workstation to isolate whether the problem
is workstation or server specific.

- If the server is required, just start the server and the Microsoft
Access workstation to test Microsoft Access. If the problem does not
occur at this point, you can start and diagnose other workstations one
by one.
 

rede96

Registered User.
Local time
Today, 01:38
Joined
Apr 2, 2004
Messages
134
Hi MStCyr,

The app will run on a dedicated PC when done, but I've been developing it on my laptop. I tried running app & closing it on the dedicated PC but got the same problem. I also did the a cold reboot but it still does it. Nothing else runs on the dedicated PC

Both running win XP pro and Office 2003

I did notice that when the database closes on the dedicated PC it asks if I want to close access and empty the clipboard....etc. I don't know why it would do this as I only start and stop the app and then close? :confused:

Maybe I need to clear any public variables/ arrays etc?
 

rede96

Registered User.
Local time
Today, 01:38
Joined
Apr 2, 2004
Messages
134
Just an Update....

I am closing the form using a command button and the code 'docmd.close'.

If I disable the command button and just close the form using the close control box. (the red 'X' in the top right) I don't get any
problems! :confused::confused::confused:

Anyway, this will do for now as I am the only one likely to use it in the short term. But it would be nice to know why this happens.
 

MStCyr

New member
Local time
Yesterday, 20:38
Joined
Sep 18, 2003
Messages
333
Just an Update....

I am closing the form using a command button and the code 'docmd.close'.

If I disable the command button and just close the form using the close control box. (the red 'X' in the top right) I don't get any
problems! :confused::confused::confused:

Anyway, this will do for now as I am the only one likely to use it in the short term. But it would be nice to know why this happens.

Hello

Maybe you could post your database so we could take a look at it, or maybe just send it to me at: stcyrm@aol.com

Best regards

Maurice St-Cyr
 

Users who are viewing this thread

Top Bottom