Link to home
Start Free TrialLog in
Avatar of woodwyn
woodwynFlag for United States of America

asked on

FoxPro printing works through 2003 Server, but not 2008 server.

We have two FoxPro applications running on multiple systems in a single domain.  SQL Server is the backend DB.  UNC networked printer share names stored in a SQL table are queried from the FoxPro applications.  The FoxPro app is set to the printer share name and sends the print job.

The query "SELECT PrinterName FROM Printers WHERE PrinterNumber='1' " returns the share name "\\Server01\Printer1" where Server01 is the 2003 server and Printer1 is a shared printer on that server.  This has worked for years on the Windows 2003 Server print spooler.  

We added a Windows Server 2008 system to the domain.  

The query "SELECT PrinterName FROM Printers WHERE PrinterNumber='2' " returns the share name "\\Server02\Printer2" where Server02 is the 2008 server and Printer2 is a shared printer on that server.  This does not work.  Server02 is a HyperV guest OS where the host OS is Server 2008 Enterprise.  (This is NOT R2).  Server02 has been set up as the print spooler for the domain and is working as such for all purposes other than the FoxPro print jobs.  
Avatar of tusharkanvinde
tusharkanvinde
Flag of India image

Do you mean that the query is not giving the correct result or that VFP is not able to print to \\server02\printer2
Avatar of woodwyn

ASKER

The FoxPro apps and SQL DB have not changed at all.  The query is returning the expected results.  It is the print jobs themselves that are failing.  

FYI, this process of the FoxPro apps querying the SQL table for the networked printer UNC share name is still working where the print spooler is still the 2003 server.  For example: The FoxPro apps can send print jobs to \\2003ServerName\Printer1.  But if I change the value in the SQL table to the 2008 server, \\2008ServerName\Printer1, the print jobs do not get to the printer.

I know the local systems are using 2008ServerName as their print spooler for some printers, so the new server is online and appaerently functioning as a print spooler.  

I will confirm when I get onsite early this week that I can send print jobs from the local systems via 2008ServerName to the same printers the FoxPro apps are trying to print too.  I am 99% sure this is working already, but I will confirm it.  

For some reason I cannot determine, the FoxPro apps cannot send print jobs through the new server using the same UNC concept that works with the 2003 server.  We suspect there is a security issue or a protocal change on how FoxPro and 2008 server communicate. Or maybe we are missing something alltogether in the configuration of the new server.  

The FoxPro commands used after capturing the printer share name (For example, lcPrinter="\\2003ServerName\Printer1") are:
lcPrinter="'"+ALLTRIM(lcPrinter1)+"'"  &&  Remove blank spaces and add single quotes to lcPrinter
SET PRINTER TO NAME &lcPrinter
REPORT FORM source\workorder TO PRINTER NOCONSOLE
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of woodwyn

ASKER

On 9/30/2010 I will be able to test Olaf's suggestion.

There are multiple uses for these shared printer names throughout the FoxPro apps.  For example, when a new work order is printed the job is sent to printers 1 - 8, the share names for which are all stored in the SQL table.  This is really convenient for them and I'd hate to have to tell them it will no longer work.  SYS(1037) will not efficiently help them send WorkOrders.frx out to 8 printers.    
Hi Woodwyn,
Your problem should be solved with Olaf & tusharkanvinde solutions. I had some similar problems and my solution was the same as they said.
In Windows 2008 64 bits, I had a problem with a driver used to generate PDFs. By default, it is configured to  print to LPT1. But instead of generate the PDF, the reports whas printed to another printer. My solution was to create another PORT as a local port, and configure it with the PDF print driver.
I hope your problem is not a listbox with the option disabled.. It can sound silly, but when you have some different options in a listbox, if it begin with \\ it will be dissabled...
Any success. You could also test with ANetResources(laArray,"\\Server02",2), which printers foxpro is able to see. Check the security tab of the properties of the printer to see which users are allowed to use it. There can be limitations, even if in general the printer is shared to print for everyone.

Bye, Olaf.
Avatar of woodwyn

ASKER

Nothing we did would resolve this issue.  As a work around I installed the printers the FoxPro app requires on a 2003 server and send the print jobs through this server instead of the 2008 server.  I don't believe this is a FoxPro issue as much as it is a network issue as other systems are experiencing printer issues as well.  I am waiting for their network admins to resolve those issues before attempting to take this on again.
Avatar of woodwyn

ASKER

Olaf, do you think this issue may have similar causes to another issue addressed this morning - "FoxPro app with SQL ODBC connection won't run on 64 bit system".  The 2008 server we added is a 64 bit server.  FoxPro is printing via the 32 bit Windows 2003 server without issue, but can't print through the 64 bit 2008 server.  
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vitiris
vitiris

One more thing - can you see what GETPRINTER() is returning for that printer.  It could be different than what the user has the printer name set to.
Avatar of woodwyn

ASKER

All suggestions were tried.  No resolution was found.  We have a secondary, Windows Server 2003, server that allows these print jobs to pass through.  

All functions passed on in the issue by everyone are legitimate and may be helpful for others.  I am going to close out this issue and accept multiple solutions.  

Thanks to everyone who offered help.  
Avatar of woodwyn

ASKER

The 2008 server was used and passed down from a larger branch to this one.  It seems to have been having issues other than this one all along.