Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET PRINTER TO NAME fails with error 1957
Message
De
16/04/2013 23:00:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01571156
Message ID:
01571170
Vues:
49
I have multiple users connected to a shared data server, that also has three printers attached. The user machines were all switched over from Vista machines to Win-7 32 bit machines, and one to a Win-7 64 bit machine ... all without without incident. The client has recently switched the server to a Win-7 32 bit system, and that's when the print spooler problems started. Typical code used to switch printers is:

* send output to Label Printer
gcDefaultPrinter = alltrim(MyPrinters.cLabels)
SET PRINTER TO NAME (gcDefaultPrinter)

The first fix attempt was to go after the printer driver for the Epson LQ-590 impact printer, that I control with good old escape codes for on the fly font size changes on longer lines to keep them within the bounds of the labels (Company names and other variable length fields).

Unfortunately, Epson doesn't seem to have a download for a Win-7 driver for this printer (that they still manufacture). A search told me that there was a Win-7 driver for this printer in Win-7 itself, and that if installed with the Win-7 printer wizard, all would be well. My user is somewhat remote from me, and I'm just assuming that he did that correctly.

With that behind me it still didn't work (still producing an error "1957 - Error accessing printer spooler" message when the TO NAME line got executed). Interestingly, the printer target does get switched, but the subsequent attempt to switch back to the report printer would not happen.

I then fought with trying to get a WIN32API setdefaultprinter approach to work (although I'd prefer not to change the servers default printer, which could led to some surprises for the other users). I've been having trouble with doing this anyway, so I decided to ask for some help.

Your thought of SET PRINTER TO NAME not being a problem makes me thing that the printer driver might still be the problem.

Any thoughts would be greatly appreciated.

Bob


>SET PRINTER TO NAME works fine under Windows 7. You have to provide more details in order to diagnose the problem.
>
>>SET PRINTER TO NAME gives me error 1957, when sent to a Win-7 32 bit machine.
>>
>>1957 is Error accessing printer spooler, and is described as "An internal call to the GetPrinter( ) function has failed. Visual FoxPro calls this function through either PRTINFO( ) or SET PRINTER TO."
>>
>>I'm looking for a fix, or a work-around. My Client has moved to Win-7. Everything worked fine previously under Vista.
>>
>>Bob
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform