Solved

Service can't print while not logged in

Posted on 2002-07-29
5
149 Views
Last Modified: 2010-05-01
When I have my VB app running as a service and attemt to print to one of the printers I get the error

Unable to set selected printer (\\Server\Printer) as active printer when I try to set the active printer

and
Print Error 482 when I try to print regardless (as you do)

which is probably no active printer (surprise surprise)

Yes, I'm not logged in the service executes under a service account.

I can see the network drives not logged in (using unc's) but the printers disapear.
0
Comment
Question by:innovate
5 Comments
 
LVL 3

Expert Comment

by:sanjaykattimani
ID: 7187275
Yes if you are not logged in, you will not be able to print on network printer as you will not have access to them. if you want you can avoid the error by checking the currently logged in user name in your code.
0
 
LVL 2

Author Comment

by:innovate
ID: 7187363
Services such as BackupExec are able to print to network printers when the Server is not logged in so it is possible.

The Service executes with Admin rights and can see ALL network drive shares, it MUST be able to see the printers.
0
 
LVL 4

Accepted Solution

by:
mcoop earned 100 total points
ID: 7187425
You may need to create a temprary 'share' to the desired printer - although I know how to connect to shares in code - I don't know how to get to the printers...
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7187869
Can you run your service as specific user by setting your service properties
0
 
LVL 2

Author Comment

by:innovate
ID: 7189602
Yes EDDYKT,

As mentioned the service executes under a particular account which has Admin rights.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now