access to a file from a connection string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

Hello,

I have build a binary .exe program installed on some client PC's that is
supposed to read a configuration file (MyXMLDoc.xml format) located in a
folder of my WindowsNT server. The TCP/IP address of this server =
10.33.2.10, the path where to find MyXMLDoc.xml on the server =
c:\MyFolder\MyXMLDoc.xml and MyFolder is a shared folder.
In my application code, I use a connect string like
\\10.33.2.10\MyFolder\MyXMLDoc.xml
Here is my problem: this access by code does not allow me to access to the
server.
Nb: If i'm getting access to the server first via the windows explorer and
the windows logging prompt, the problem disappears as the logging 'has
already opened the gate'.
My question is: how to sign in to the server by code or how to 'open the
gate' of my server?

Thank's for your help
Didier
 
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

Your "access denied" error is caused security problem. Solutions:
1. If all computers are on NT domain you have to add read rights to share
and to the file to all domain users.
2. If they are not on domain, you can add this share to NullSessionShares.
This solution will work in the case client program works a service too.
Disadvantage: anybody can remove or modify the file.
3. In the client program you do the mapping of the share to a drive (say
Y:). The function which does the trick is WNetAddConnection2. You have to
create a special account on NT server and use this account to access xml
file (and share)

Good luck!

"Didier Cabalé" <didier.cabale@free.fr> wrote in message
news:#O#cLlxIEHA.3720@tk2msftngp13.phx.gbl...
> Hello,
>
> I have build a binary .exe program installed on some client PC's that is
> supposed to read a configuration file (MyXMLDoc.xml format) located in a
> folder of my WindowsNT server. The TCP/IP address of this server =
> 10.33.2.10, the path where to find MyXMLDoc.xml on the server =
> c:\MyFolder\MyXMLDoc.xml and MyFolder is a shared folder.
> In my application code, I use a connect string like
> \\10.33.2.10\MyFolder\MyXMLDoc.xml
> Here is my problem: this access by code does not allow me to access to the
> server.
> Nb: If i'm getting access to the server first via the windows explorer and
> the windows logging prompt, the problem disappears as the logging 'has
> already opened the gate'.
> My question is: how to sign in to the server by code or how to 'open the
> gate' of my server?
>
> Thank's for your help
> Didier
>
>