Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Net Access from a VFP Service
Message
De
18/05/2006 13:23:15
 
 
À
18/05/2006 11:48:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01123251
Message ID:
01123312
Vues:
16
>I have a well used task processor that a client has asked me to convert to a Win Service.
>
>I have found many references to that here and it seams straight forward.
>
>But, if I am running as a service, is it not true that the service is running before anyone has logged in to the machine. Now if I need to access tables on another server on the LAN, how do I go about logging in and/or mapping to those tables ?

A service runs logged into an account, often a LocalSystem account, but you can specify any account you want. You can create a logon script that runs batch commands to map drives etc.

Another option that lets you avoid drive mapping entirely is to use, in your Fox code, UNC names for network resources. Suppose for example you have a server "DataServer" with a share "DataFolder", and you have a table "MyTable" in that share:
* At the moment you may be doing something like this:
* You have \\DataServer\DataFolder mapped as drive F:, so you can
USE F:\MyTable ...

* Using UNCs instead, you can
USE \\DataServer\DataFolder\MyTable ... && without having to map a drive

* If the server DataServer has a fixed IP address (say 192.168.0.5) you can even
USE \\192.168.0.5\DataFolder\MyTable ...
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform