473,695 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Huge problem with printing from ASP to network printer

Hi,

I have 2 questions :

1. - I want to print from my ASP page directly to my network printer. For
this i
use the following code, but everytime, my document to print is sent to local
and physical port LPT1 not to network printer :(

'---- to print report on network printer ---
' path = "\\domain_name\ Printer_name"
Set objFS = CreateObject("S cripting.FileSy stemObject")
Set objWSHNet = CreateObject("W Script.Network" )
objWSHNet.AddPr interConnection "LPT1:", path, False,login, pwd
else
objWSHNet.AddPr interConnection "LPT1:", path, False
end if
Set objPrinter = objFS.CreateTex tFile("LPT1:", True)
....
objPrinter.Writ e("simple printing test")
objPrinter.Clos e
'---------------------------------------------------
2. - i would like to get dynamically the printer name as also its path...how
can i do this ?

thanks in advance,
Maileen.


Jul 19 '05 #1
1 4716
Maileen wrote on 08 jul 2004 in microsoft.publi c.inetserver.as p.general:
1. - I want to print from my ASP page directly to my network printer.
For this i
use the following code, but everytime, my document to print is sent to
local and physical port LPT1 not to network printer :(

'---- to print report on network printer ---
' path = "\\domain_name\ Printer_name"
Set objFS = CreateObject("S cripting.FileSy stemObject")
Set objWSHNet = CreateObject("W Script.Network" )
objWSHNet.AddPr interConnection "LPT1:", path, False,login, pwd
else
objWSHNet.AddPr interConnection "LPT1:", path, False
end if
Set objPrinter = objFS.CreateTex tFile("LPT1:", True)
...
objPrinter.Writ e("simple printing test")
objPrinter.Clos e
'---------------------------------------------------
2. - i would like to get dynamically the printer name as also its
path...how can i do this ?


It is not at all clear to me if you are trying to print to a printer on
the network of the server using ASP-vbs or to the printer on the client's
network using IE-vbs.

The former is not very usefull, as usually the client cannot see the
printer, because it can be continents away, [unobserved printers can
cause a fire ;-} ], and if you are incidentally on the same network you
could much better use IE client printing.

The latter is also not necessary as you can use IE client printing and
also that is OT on this NG, btw.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3191
by: Daniel Iwan | last post by:
Hello everyone! I have a problem with using TCanvas Printer and network printer HP LaserJet It print just first page and throws blank all the rest. WinNT with Borland Builder 5. All works fine with my HP 3820 with USB printer (WinXP)
1
2591
by: Pohihihi | last post by:
Hello NG. I am using System.Drawing.Printing NS to print few label style printouts. I figured out how the basics goes in that namespace but there are still few things that is holding me up from completing my work. Basic problem is that when I select to print many copies or collate printout then nothing happence. It prints the first page and stops. Also I get different information regarding printer's capacity (please see below). Example...
1
3117
by: Maileen | last post by:
Hi, I want to print from my ASP page directly to my network printer. For this i use the following code, but everytime, my document to print is sent to local and physical port LPT1 :( could you help me please ? thx, Maileen. '---- to print report on network printer --- ' RSP = stored procedure
2
4630
by: alan | last post by:
I'm now using vb.net to write a POS system with a epson thermal printer. I use the ocx that provided by Epson to drive the printer. It's not the problem if I just using 1 computer vs 1 thermal printer. But now I need to use 2 computer vs 1 thermal, how can another computer use the same printer? I wonder I can send the print request and content to the computer which connecting to the printer by TCP/IP, but I don't know how to do that!
0
2075
by: Dawn | last post by:
My application is coded to create a report using Excel and I would like to send it directly to a pre-determined network printer. (My intention is to pass the printer name in a variable.) However, there is a suffix that is added to the printer name and the printer suffix is not consistent ...... "on Ne00" on my pc "on Ne01" on another pc Is there a way to consistently code the printer name ? mxlApp.ActivePrinter = "Dell Laser...
3
6304
by: Mika M | last post by:
Hi all! I have made an application for printing simple barcode labels using PrintDocument object, and it's working fine. Barcode printer that I use is attached to the computer, and this computer has drivers installed for this printer, and this printer is shared for the network. Question 1:
0
1229
by: Lars | last post by:
I am using Microsoft .NET (2.0) PrintPreviewDialog and all works well when the Windows default printer is set to a local printer or a network printer on a Windows server, but if I set it to a Samba network printer, it slows down to a crawl. With a Windows server network printer, it takes about 10 seconds to render 100 pages. With a Samba network printer, it takes over 5 minutes! I can see that the preview control is generating
3
2782
by: =?Utf-8?B?TWFyazYyNA==?= | last post by:
I have a web method that renders a SQL Reporting Services report and prints it to a network printer using the System.Drawing and System.Drawing.Printing namespaces in .Net 2.0. This method has been working without issues in production at several client sites but now I've started seeing memory errors when trying to print. The only way to resolve the errors has been to do an IISReset on the web server hosting the web service. I tried...
1
1850
by: Alex | last post by:
Hi, I'm writing an app to run on a server, hopefully autmated, and every 5 minutes it needs to hit a database and if any new records have been entered, print the record to a printer depending on certain criteria. I'm not sure if I'll handle timing through the app or through Windows Scheduler... but that's outside my question here. All our printers are Jetdirect compliant printers and on our network as \\printserver\printername or I...
0
8568
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8982
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7660
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5839
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4340
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3003
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2272
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.