Connecting Tech Pros Worldwide Help | Site Map

Write to LPT

  #1  
Old November 12th, 2005, 06:16 PM
Uros
Guest
 
Posts: n/a
Does anybody know how to write data directly to the LPT port from MSAccess.

Now I use
"Open PrtPort For Append Access Write As IntFilenum" then
"Print $IntFilenum, ..........."
but doesn't work well. LPT port does not initialize and POS printer print
weird characters.
When user print blank page from notepade, on this time, printing from
MSAccess works fine until PC is restarted.

Anybody know solution or some other method for writing data to LPT?

Thanks!
Uroš


  #2  
Old November 12th, 2005, 06:16 PM
Lyle Fairfield
Guest
 
Posts: n/a

re: Write to LPT


"Uros" <flaynb@hotmail.com> wrote in news:HZTGb.439$%x4.75061@news.siol.net:
[color=blue]
> Does anybody know how to write data directly to the LPT port from MSAccess.
>
> Now I use
> "Open PrtPort For Append Access Write As IntFilenum" then
> "Print $IntFilenum, ..........."
> but doesn't work well. LPT port does not initialize and POS printer print
> weird characters.
> When user print blank page from notepade, on this time, printing from
> MSAccess works fine until PC is restarted.
>
> Anybody know solution or some other method for writing data to LPT?
>
> Thanks!
> Uroš[/color]

1. What is PrtPort? Is it a string holding "LPT1" or similar?

2. I send initialization strings before I begin to print:

.... snippet (for an ancient dot matrix printer)

initialize = Chr(27) & Chr(64)
sixLPI = Chr(27) & Chr(50)
tenPitch = Chr(27) & Chr(80)
bold = Chr(27) & Chr(69)
doubleStrike = Chr(27) & Chr(71)
nonproportional = Chr(27) & "p0"
eject = Chr(12)
printerCodes = initialize & sixLPI & tenPitch & bold & doubleStrike &
nonproportional

.... later

' open the print file
' "LPT1" or "LPT2" etc
fileName = DLookup("Port", "Printer Port", "ID = 1")
' Printer Port is simply a table where one can select the local
printer port
fileNumber = FreeFile()
Open fileName For Output As fileNumber

' printer codes
Print #fileNumber, printerCodes

' data
For iCount = 1 To 60
Print #fileNumber, aLines(iCount)
Next

' return printer to original state
Print #fileNumber, initialize

.... later still ... in normal exit code that errors resume to

Close #fileNumber

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
  #3  
Old November 12th, 2005, 06:17 PM
TC
Guest
 
Posts: n/a

re: Write to LPT


In your code, PrtPort should be a string variable containing the relevent
parallel port device name, eg. "LPT1:". That should definitely open that
port. What is in your PrtPort variable? What leads you to say that the LPT
port "does not initialize"?

HTH,
TC


"Uros" <flaynb@hotmail.com> wrote in message
news:HZTGb.439$%x4.75061@news.siol.net...[color=blue]
> Does anybody know how to write data directly to the LPT port from[/color]
MSAccess.[color=blue]
>
> Now I use
> "Open PrtPort For Append Access Write As IntFilenum" then
> "Print $IntFilenum, ..........."
> but doesn't work well. LPT port does not initialize and POS printer print
> weird characters.
> When user print blank page from notepade, on this time, printing from
> MSAccess works fine until PC is restarted.
>
> Anybody know solution or some other method for writing data to LPT?
>
> Thanks!
> Uroš
>
>[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
step in-between printer (LPT) werdna.sivad@gmail.com answers 14 November 26th, 2005 09:15 AM
step in-between printer (LPT) werdna.sivad@gmail.com answers 14 November 26th, 2005 09:15 AM
send hex to com port 1 steve answers 1 November 15th, 2005 07:52 PM
Transfer Printfile from Printserver directly to Printer Martin Vogler answers 4 July 23rd, 2005 04:53 AM