13 replies
by lucik
I have a similar problem. For now I use VB program that read
COM port into a file and then Access read the file.
I did not find in Access VBA support for COM yet.
Sergey.
by dennis
by lo
Hi
I didn't/haven't done this but, isn't it possible to just open a com port as an i/o device, like you would with file on C:\, D:\, etc? Given that, you should be able to use your modem program inside Access directly. The ... Input ... below should be Input/Output, didn't lookup syntax. Try something like:
Open "COM1:TESTFILE" For Input As #1
There is no reason this shouldn't work that I can think ofm it's just file i/o. There was a restriction in the Help for OPen that file namescan't be PRN, COM1-COM4, NUL, etc. but this isn't a file name it is a device/file name specification, same as C:\TESTFILE would be.
If for some reason, you can't use the Open statement on COMn:, you can set up the process with an external application (you can most likely launch from Access if it isn't running), read/write to a disk file from Access and let the launched program (the one you have already written) to send data from Access to the modem and data from the modem to a data that Access could read via a f
by dennis
by mikedale
Try Answer 2, Recently I wrote a VB program where I needed to Read and Write data directly to the parallel port. I was able to write to the Parallel port using the follow. Open "lpt1:" for output as #filenumber
You shoulb be able to Open the Com port in VBA using Open "Com1:" for input as #filenumber
Like Answer 2 I have not tryed this in Access (VBA).
If this does not work I got and I/O dll free from the following web site, http://www.lvr.com/parport.htm
The Code supplied is to read and write to the parallel port but could be easily adapted to work on a serial port in, VBA sample code comes with the dll. Also I recall seeing some referances on this web site to direct accessing the com port, have a look. Note if you direct access a port in VB or VBA it will not run on WinNT or WIN 2000
Hope this helps
Ragards
Mike Dale
by dennis
by bacon78
There are Third Party Controls out there For you to use but its realy not worth it unless they are specialized for that Bar code Reader.
Microsoft supplies a Com32 Control.
If don't have it you can Down load it from there web site.
I used this to interact with A piano Labe Control Built by Technics.
Take a look at the control. Setup the control to the correct com port and read in data from the port through the buffer and see what the scanner is sending and go from there.
Hope this helps.
If you need any more help send me and email at bmennenga@micropace.com
by dennis
VBA is the Office VB. Traditionally this subset doesn't have any I/O power. The beauty is that you can use some of Win32 API. Try MSDN to find your right API call then make a Dim function like this:
Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg _
As Long, ByVal wParam As Long, _
lParam As Any) As Long
luck...
by dennis
by irishtlr
Dennis,
This is relatively simple using the COMM control that comes with either VB or Access. It's very easy to use. If your interested in using it, send me an EMail [ranger@oceanfree.net] and I'll send you some sample code. I have created a program that reads information from a barcode scanner via the comm port. Not hard at all.
RangeR
by dennis
by dennis
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending