Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET PRINTER TO NAME command
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SET PRINTER TO NAME command
Miscellaneous
Thread ID:
01530038
Message ID:
01530038
Views:
221
We are really struggling here with error 1957, "Error accessing printer spooler." This error has occurred with some regularity over the past year or so (which is as far back as I have error log data) but for some reason has spiked this month.

The error occurs on the second line of code here:

m.cLocalMachineName = UPPER(gaPrinters(i,1))
SET PRINTER TO NAME (m.cLocalMachineName)

I googled "foxpro set printer to name problems" and got some hits. Some were simple user error, for example not referencing the name as a name expression or macro substitution, but others lead me to question the reliability of the command. There was a discussion on "the other FoxPro forum" in 2009 in which the original poster was convinced there is a bug in VFP. He said the default printer is always used regardless of what SET PRINTER TO NAME sets it to. The suggestion was made to issue SET PRINTER TO DEFAULT first. I tried that and it didn't work. There was also a suggestion, which I will try, of changing the printer via a Windows call instead of doing it from VFP.

The users and their managers are going a little batty over this. Any suggestions?
Next
Reply
Map
View

Click here to load this message in the networking platform