Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network printing with w2k & fpd26 2

Status
Not open for further replies.

yeti

Programmer
Mar 22, 2001
33
GB
Hi,

I'm successfully using FP2.6 (DOS) on a PC running Win98 connected to an NT4.0 server. However, I'm now try to use a shiny new win2000 PC connected to the same network and am having difficulties printing from FP.

Previously I used the command:

SET PRINTER TO \\server\queue=LPT1:
SET PRINT ON
? "HELLO"
SET PRINT OFF
SET PRINTER TO

When running with the win2000 PC I now get the error message:

"invalid printer redirection"

To get around this I used the "NET USE LPT1 etc" command to 'capture' a printer port then changed my code to use the command:

SET PRINTER TO LPT1:
SET PRINT ON
? "HELLO"
SET PRINT OFF
SET PRINT OFF
SET PRINTER TO
SET PRINTER TO

This appears to work (with the multiple "PRINT OFF" & "PRINTER TO" commands required to release the job) but it's pretty ugly.

Can anyone explain why my original "SET PRINTER TO \\server\queue=LPT1:" command reports an error on the w2k PC? It even reports the error if I previously use the "NET USE" command.

Thanks in advance
 
Any chance the vales for <server> or <queue> in \\server\queue are greater than 8 characters or have an embedded space? Remember when FPD was released, the DOS world was restricted to the 8.3 filename and 8 character device name limitations.

Rick
 
My exact syntax is:

SET PRINTER TO \\comms1\faxlaser=LPT1:

...which is within the 8 character limits.

Although I do have some printer queues that are a couple of characters longer - but these all worked when using fpd2.6 on a win95/98 PC...

Any other suggestions?
 
NET USE LPT1: /d
SET PRINTER TO \\comms1\faxlaser=LPT1:

The use of first line could solve the problem. I have not tried this yet but.

ramani :)
 
Thanks for the input Ramani.

The /D successfully removed any existing redirection on the LPT1 port but I still get the same FoxPro error when using the SET PRINTER TO command.

Interestingly, although FoxPro says &quot;INVALID PRINTER REDIRECTION&quot;, the NET USE command shows that the new redirection is in place. IE. the command works.

So why am I getting this error message and how can it be stoped?
 
I have a feeling that you are using the NOVELL specific redirection command for W2K.
1. NET USE LPT1: /d
is used for any inadvertent earlier setting not reset.
2. NET USE LPT1: \\PrintServerName\PrinterName /YES
is used for proper redirection
3. Start the FoxPro application
The print routine in FoxPro is left to the generic
default location.. REPORT FORM rotForm TO PRINTER etc
4. When the application ends... complete with
NET USE LPT1: /d
to terminate the capture.
1/2 can be done at the starting of OS or as separate batch file on desk-top or as a pre-run batchfile of the application icon on the desktop. This will solve the problem.

ramani :)
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Thanks for all the input - still no banana though.

I recreated my w2k redirection as suggested (the only difference being the /YES switch to ensure the setting is restored at next logon) - and then ran several of my fpd2.6 applications.

Same error INVALID PRINTER REDIRECTION appears and same result - the reports print and the redirection is successfull. Why the error message?

Interestingly, I get the same result even if I remove the W2K redirection beforehand - eg. NET USE LPT1: /DELETE then, in FoxPro, SET PRINTER TO \\server\sharename etc..

In this situation, the W2k redirection is correctly created by FoxPro but still the above error message...

So far, Eg.

I set LPT1 to redirect to \\comms1\faxlaser as follows:

NET USE LPT1: \\comms1\faxlaser /YES

Some of my fox applications use report form whilst others use set print on etc. - All gave the same error message.

So, for example, I use the command:

SET PRINTER TO \\comms1\faxlaser=LPT1:

or if I'm changing the redirection to another queue...

SET PRINTER TO \\comms1\invlaser=LPT1:

...Either command will spawn the error message.

The server is running NT4, the client W2k - it worked fine under w95/98 - I did not even have to use the capture option available in these o/s to make it all work.

Bring back dos & netware! At least I didn't expect it to work in the good old days :)
 
Yeti,

How did you eventually solve this problem. I seem to have stepped right into your shoes, and I think many more out there will have the same query as they upgrade there hardware and OS to Win2k.


Can you update me.

Maricus
 
I am sorry yeti... things did not work for you..
I have similar setups of NT4, W2k, Win98, combinations with number of my clients and I never faced any of these problem. I shall count .. 'may be I am lucky!?'

Just a quick thinking, I have also used other networks such as ILAN, workgroups, Novel, LanSmart, Linux etc, Some of the operating systms have their own MAP, CAPTURE etc commands instead of net use. The idea is, in your network identification, is the primary network (configured) specified as something other than NT.

I do have come across situation, when, if the W2k unit is not first reset to USE local LPT1 after the first capture command, the second such redirection fails. So I make it a point to first set the capture command to LPT1 (local) and then give the capture command to the required printer. May be this is your situation as well.

Anyway Best of luck! ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
I tend to think this is a Windows 2000 problem. It seems to me that Win2k is not able to spool MS-DOS print jobs - right or wrong? Picture this:

I shelled to command prompt in win2k. I tried to print DIR>PRN or print but nothing emerged out of the only capture printer in my win2k.


When I return to the windows and go to printer properties and try a test page. It goes!

Any idea this far? Can Microsoft help out here?

Maricus
 
Microsoft's solution (Q245017) seems to be valid only
for NT 4.0 . Is it possible to write to a file and
open the file in a Windows program with writing capability ?
 
No, I've yet to find a solution to this problem yet.
In answer to the various questions posed since my last visit:

1) The primary network is NT (in fact its the only network)
2) Resetting the printer to local use (via NET USE and
SET PRINTER TO) has no effect. CAPTURE not used as
am using an NT network.

Ultimately the jobs eventually print - but why the error message..!

Where am I going wrong?
 
Have now decided to cheat. Have modified my ON ERROR trapping routing to ignore the &quot;Invalid Printer Redirection&quot; error. Far from ideal I know (call m'self a programmer!) but, as I still get my printouts and have yet to hear a better solution....

Someone out there please shame me into fixing this problem properly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top