Solved

Service can't print while not logged in

Posted on 2002-07-29
5
148 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Can you run your service as specific user by setting your service properties
0
 
LVL 2

Author Comment

by:innovate
Comment Utility
Yes EDDYKT,

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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

772 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

12 Experts available now in Live!

Get 1:1 Help Now