
Looking for Example using API for COM-Port in Access 97
Hi,
One of the easiest way is to use MSComm.OCX. It's packaged with VB, no
Access and even if it is not officially accredited to work with Access, my
experience show that it is working reasonably well.
An example, from VB doc:
Comm1.CommPort = 1 ' First serial port
Comm1.Settings = "9600,N,8,1"
Comm1.InputLen = 0 ' read the entire buffer when Input is used
Comm1.PortOpen = True
Comm1.Output = "AT" & Chr$(13) ' or what you wish to send
Do
DoEvents
Loop Until Comm1.InBufferCount >= 2 ' wait until the message is completed,
here OK,
' can check, instead, for the presence of a
character, ....
InStr$=Comm1.Input
Comm1.PortOpen = False ' If you don't close it, will stay open as long as
Access is alive.
Hope it may help,
Vanderghast, Access MVP.
Quote:
>Im looking for an example to use the COM-Port in
>Access 97. I need to communicate for data-exchange with
>a micro-controller via the serial port with send and
>receive, Please, who can help me with an example
>module.
>Thanks
>michael foth