Can't get xp_cmdshell command to print to network printer 
Author Message
 Can't get xp_cmdshell command to print to network printer

I've spent a week trying to send information to a network printer using
xp_cmdshell.

I have the following trigger set in my table:

CREATE trigger dbo.ticketprint
ON dbo.ticket
FOR Insert
AS


  + " entered " + rtrim(convert(varchar, getdate()))
  + " > \\jkimrey\ttprinter")

GO

The trigger will work if I go to a command shell and enter 'net use
\\jkimrey\ttprinter'; however, it will only work as long as I remain logged
onto the system.  Once I log off the trigger will cease to work, AND it will
slow the system to a crawl.

Other details:
-SQL Server 6.5 running on NT 4.0 Server
-network printer attached to an NT 4.0 Workstation with sharing enabled.

Any suggestions would be great!

-=Jay=-



Tue, 05 Dec 2000 03:00:00 GMT
 Can't get xp_cmdshell command to print to network printer

James,

 The MSSQLSERVER service must be running under a user account with the
relevant network permissions.

 Neil Pike MVP/MCSE
 Protech Computing Ltd



Wed, 06 Dec 2000 03:00:00 GMT
 Can't get xp_cmdshell command to print to network printer

Thanks for the help Neil!

I created a user account with admin privilidges and used Server Manager to
reassign MSSQLServer to run under the user account.

Can I set the user account to a lower set of privilidges, or does
MSSQLServer need admin privilidges?

-=Jay=-

Quote:

>James,

> The MSSQLSERVER service must be running under a user account with the
>relevant network permissions.

> Neil Pike MVP/MCSE
> Protech Computing Ltd



Fri, 08 Dec 2000 03:00:00 GMT
 Can't get xp_cmdshell command to print to network printer

James,

 It doesn't need admin privileges - it just needs ordinary user
privileges to connect to network drives/printers.  (Whatever account
you use it does need the 'log on as a service' user right.

 Neil Pike MVP/MCSE
 Protech Computing Ltd



Sat, 09 Dec 2000 03:00:00 GMT
 Can't get xp_cmdshell command to print to network printer

Neil,

I tried giving the MSSQLService account only user privileges, but the
service would not start.  The Event Log contained the following detail:

Mesg 17113 : initconfig: error 2(The system cannot find the file specified.)
opening 'master.dat' for config information

I thought it might be caused by lack of privileges so I went through user
manager gave the account the same privileges as the admin account.  That
didn't work.

I thought it might be directory access so I went through the mssql directory
and gave the account access.  That didn't work either.

I thought it might be a home directory problem so I removed my home
directory assignment for the account.  That didn't work.

Any suggestions?

On the bright side, the printer is now working with sqlserver!  Thanks for
all the help!

-=Jay=-

Quote:
><> James O. Kimrey, III <><

Jr Application Developer
Econophone, Inc.


Mon, 11 Dec 2000 03:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Network Print Command for Pd7 getting Illegal Operation Error

2. Can't print to a network printer on a Windows NT Workstation Peer to Peer

3. FPW2.6 printing to network printer w/SET DEVICE TO PRINTER

4. Getting the toolbar printer icon to print

5. Getting rid of 'FindFast' Commands

6. printing crystal reports to a network printer

7. printing to network printer from win98

8. Paradox 7, NT - printing to network printers

9. Print to Network Printer from P9...?

10. printing from paradox 4.5 to a network printer

11. Print to network printer problem

12. Printing to Network Printer & setting path


 
Powered by phpBB® Forum Software