Send a string to an ethernet attached printer

P

Paul Kraemer

Hi,

I have to write an Access application that will be able to print barcode
labels.

My barcode printer is connected by ethernet. If I go to printer properties
on the Ports tab, the printer is set to print to a "Standard TCP/IP Port"
with the IP address that I assign to the printer. The printer works fine
from my barcode software, but now I want to be able to generate barcode
labels automatically from my Access application.

Supposedly, all I have to do is send the printer a string of characters
(some printable and some not). For example, I might want to send the
following string to the printer:

<02h><1Bh>String that produces a barcode<5Ah><03h>

I can assemble the necessary string in Access, but I have no idea how to
send it to the printer. If anyone can give me a clue how to do this, I would
really appreciate it.

Thanks in advance,
Paul



..
 
D

Dennis

Hmmmmm..... It sounds like you're trying to send printed data the "old
fashioned way" (like I used to do back in the day) to a serial printer. You
may find some success researching "Streams" in VBA. Here's a snip from Help
on Streams:


Streams

The Stream object provides the means to read, write, and manage a stream of
bytes. This byte stream may be text or binary and is limited in size only by
system resources. Typically, ADO Stream objects are used for the following
purposes:

To contain the text or bytes that comprise a file or message, typically used
with providers such as the Microsoft OLE DB Provider for Internet Publishing.
For more information about this use of Stream objects, see Using ADO for
Internet Publishing.

A Stream object can be opened on:

-A simple file specified with a URL.
-A field of a Record or Recordset containing a Stream object.
-The default stream of a Record or Recordset object representing a directory
or compound file.
-A resource field containing the URL of a simple file.
-No particular source at all. In this case, a Stream object is opened in
memory. Data can be written to it and then saved in another Stream or file.
-A BLOB field in a Recordset.
-------------------------------

That's about all I know about it. These days, I just create a report (even
if that report is just a detail section with no header/footer or summary
info). Then I can "print" the report to whatever printer I want. IIRC,
there's a way to specify what printer you want the specific report to be sent
to. You could fill special "format fields" with the data you need to setup
the barcode font(s) correctly.

Sorry to be so vague, but I haven't had to actually code BC printers in over
a decade. (I used to do so routinely for various automated data-collection
and control systems.) Hope it helps a bit.
 
S

Stuart McCall

Paul Kraemer said:
Hi,

I have to write an Access application that will be able to print barcode
labels.

My barcode printer is connected by ethernet. If I go to printer
properties
on the Ports tab, the printer is set to print to a "Standard TCP/IP Port"
with the IP address that I assign to the printer. The printer works fine
from my barcode software, but now I want to be able to generate barcode
labels automatically from my Access application.

Supposedly, all I have to do is send the printer a string of characters
(some printable and some not). For example, I might want to send the
following string to the printer:

<02h><1Bh>String that produces a barcode<5Ah><03h>

I can assemble the necessary string in Access, but I have no idea how to
send it to the printer. If anyone can give me a clue how to do this, I
would
really appreciate it.

Thanks in advance,
Paul



.

This should be right up your street (send binary data to local or network
printer using the print spooler)

http://www.smccall.demon.co.uk/Downloads.htm#LinePrint
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top