Connecting Tech Pros Worldwide Help | Site Map

Write to LPT

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 05:16 PM
Uros
Guest
 
Posts: n/a
Default Write to LPT

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, 05:16 PM
Lyle Fairfield
Guest
 
Posts: n/a
Default 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, 05:17 PM
TC
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.