Hi all,
I'm trying to create an application that could monitor and trap incoming serial data within Access, and I'm wondering what is the most efficient way to do this.
Imagine a storage management application in which incoming barcode scan data or RFID data can open a form displaying corresponding records.
It is not the typical data-logging application: the application's main purpose is not only to listen and log the data, and the incoming data will be a relatively rare event, so the application must listen to the serial port in the background and keep being responsive for other uses.
I managed to get serial data using the commIO code posted by David Hitchner, which calls the Windows API. However, for now, I'm using a loop to read serial data and sleep for 500 ms. This obviously makes the application not very responsive. I was wondering if there's a better way to do that.
I've tried for a brief while using the mscomm32 ocx in Access, but failed (possibly wrong version of the DLL?). It doesn't seem to be the recommended method anyway.
I was thinking of writing a serial monitor windows service (probably in C#) that would raise a windows event whenever incoming data is detected, but I don't know how to consume the event in Access: is this possible at all?
If I can't consume a windows event within Access, another option would be to have the service poke the Access application in a way or another -- but the windows service beeing a different client than the GUI, it can't share variables with the Access application. It could insert a row in a table, but there is no trigger method in Access AFAIK...
I hope I'm making sense. Any help or suggestion would be very welcome.
Thanks!
I'm trying to create an application that could monitor and trap incoming serial data within Access, and I'm wondering what is the most efficient way to do this.
Imagine a storage management application in which incoming barcode scan data or RFID data can open a form displaying corresponding records.
It is not the typical data-logging application: the application's main purpose is not only to listen and log the data, and the incoming data will be a relatively rare event, so the application must listen to the serial port in the background and keep being responsive for other uses.
I managed to get serial data using the commIO code posted by David Hitchner, which calls the Windows API. However, for now, I'm using a loop to read serial data and sleep for 500 ms. This obviously makes the application not very responsive. I was wondering if there's a better way to do that.
I've tried for a brief while using the mscomm32 ocx in Access, but failed (possibly wrong version of the DLL?). It doesn't seem to be the recommended method anyway.
I was thinking of writing a serial monitor windows service (probably in C#) that would raise a windows event whenever incoming data is detected, but I don't know how to consume the event in Access: is this possible at all?
If I can't consume a windows event within Access, another option would be to have the service poke the Access application in a way or another -- but the windows service beeing a different client than the GUI, it can't share variables with the Access application. It could insert a row in a table, but there is no trigger method in Access AFAIK...
I hope I'm making sense. Any help or suggestion would be very welcome.
Thanks!