Reading Serial Port From Access?

  • Thread starter Thread starter Mucip
  • Start date Start date
M

Mucip

Hi,
I want to read serial port from Access form. There is a
indicator which is send 11 characters long string like
continious form. And I want to read this string from
Access form. How can I do that?

Best regards,
Mucip:)
 
The old VB ( QB ) serial commands still work:

Dimension an 11 byte string:

dim StrInput as string * 11

Set the Comm port number, speed, parity, stop bits, plus any handshaking:

Open "Com1:9600,n,8,1" for input as #1
Input #1,strInput
Close #1

do whatever you want with the string.


--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Access does not support serial I/O directly and you will need to use a
3rd party tool to do the job. The easiest tool to use for the type of
application that you describe is a product called WinWedge from TAL
Technologies, Inc. For more information about WinWedge visit:
http://www.taltech.com/TALtech_web/products/winwedge.html
WinWedge is an executable program that is designed to run in the
background and feed incoming serial data directly to other Windows
programs line Excel, Access, etc. by either stuffing the serial data
into the keyboard buffer so that the data appears as if it is being
typed in or the program can also pass the data using Dynamic Data
Exchange (DDE). With the DDE method, you can set up WinWedge to
trigger an event in Access so that it runs a VBA subroutine when
serial data is received and the subroutine can then perform a DDE
request back to WinWedge to get the serial data and put it wherever
you want the data to go (into a textbox, directly to a table, etc.)
WinWedge also supports full two way I/O so you can send data out the
serial port as well. It is a very easy program to use and should have
you up and running in short order.
 
Doing serial I/O in Access is extremely difficult without using a
third party tool.
You can no longer open a COM port like you can a file in VBA - Windows
does not allow it.
The easiest tool to use to do serial I/O in Access is a product called
WinWedge from TAL Technologies. For more information, visit:
http://www.taltech.com/TALtech_web/products/winwedge.html
WinWedge will make the job easy and painless.
 
I just tried opening a COM port in Access 2002, Windows 2000, and it works
fine, using nothing more than:

Open "Com1,9600,n,8,1" for output as #1
Print #1,"This is a test"
Close #1

I didnt think that would work either, but I think it was John Vinson who
pointed out the the old QB commands still work.

And of course you can always use the MSComm control installed with VBxx, if
you want more control, and proper IRQ driven comms.


--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top