General information
Category:
Coding, syntax & commands
Title:
SET PRINTER TO NAME command
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only