Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing error: PCL XL error

Status
Not open for further replies.

melvt69

Programmer
Jan 22, 2003
13
ZA
Hi,

I am working in VB6. What i need to do is the following:

execute a query and write the results to the printer.
The code that i used is "theoretically" correct, but yet i get only an error message on the page when it prints.

The code i use:

Call modLibrary.OpenConn

str = "SELECT Afdelings.KSentrum, Afdelings.KBeskryf, Afdelings.KPersoon, " _
& "Verspreiding.ID, Boeke.Naam, Verspreiding.Aantal " _
& "FROM (Verspreiding INNER JOIN Afdelings ON Verspreiding.KS_id = " _
& "Afdelings.KS_id) INNER JOIN Boeke ON Verspreiding.ID = Boeke.ID " _
& "Where (((Verspreiding.ID) = '" & strBookID & "')) " _
& "ORDER BY Afdelings.KSentrum;"

Set rs = cn.Execute(str)

With rs
'set printer settings
Printer.TrackDefault = True 'print to default printer

Do While .EOF = False
'print infO
Printer.Print Tab(10); Trim(!Naam)
Printer.Print Tab(10); Trim(!KSentrum); Spc(5); "-"; Spc(5); Trim(!KBeskryf)
Printer.Print Tab(10); "Kontak Persoon"; Spc(3); "-"; Spc(3); Trim(!KPersoon)
Printer.Print
Printer.Print Tab(10); "Hoeveelheid = "; Trim(!Aantal)
.MoveNext
Loop
Printer.EndDoc
End With
Call modLibrary.CloseConn
end sub

the msg i get on the printing page is:

PCL XL error
Subsystems : KERNEL
Error : IllegalStreamHeader
Operator : 0x0
Position : 0

Please help?
 
I've found the answer to this one. I totally messed up my printer drivers while i was playing with the settings programmatically.
i just re-installed it and it's working fine. there's absolutely nothing wrong with the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top