Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing Reports While logged out??
Message
De
19/01/1999 13:36:48
 
 
À
19/01/1999 12:38:56
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00177639
Message ID:
00177685
Vues:
36
>>>>>I have an application that automatically runs each night and loads a lot of data from some text files. I have the job running while I am logged out. I am trying to print some reports and they do not print.
>>>>>
>>>>>Does any one know if of how to connect to a network printer while no one is logged on so that the reports can print?
>>>>>
>>>>>I am using Fox 2.6, NT 4.0
>>>>>
>>>>>Thanks,
>>>>>
>>>>>James
>>>>
>>>>Sorry, I don't follow you here. If you want to print something on network printer, then you should be connected to this printer, i.e. you must log on network. What actually prevents you from doing this? Or you mean that the same application which runs text file processing should also print?
>>>
>>>
>>>Yes, sorry for the confusion . . . It prints some reports while processing at night while no one is logged in . . . . Is there a way to connect to the network printer programmatically without logging on?
>>>
>>>Thanks
>>
>>The only way you can connect to a network printer is to be logged into the network and have the privelages to access the printer. You instead need to be looking into how you can programatically login.
>>
>>Wayne
>
>
>Thanks, for the help . . .Do you have any ideas on how to programatically login?

You can attach a device (drive or printer) using the WNetAddConnection() API call. The API call prototypes as:
DECLARE INTEGER WNetAddConnection IN Win32API ;
 STRING cRemoteUNC, ;
 STRING cPassword, ;
 STRING cLocalDevice
To attach \\MyServer\Printer1 as LPT4: under my current userid:

=WNetAddConnection('\\MyServer\Printer1',cMyPassWord,"LPT4:")

You can also use the Wscript.Network object to attach printers; it's more flexible, in that it will allow you to specify a userid and password when connecting the device. You need to install the Windows Scripting Host to maek the Wscript.Network object available to your system.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform