PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Using a network path not working

Reply

Using a network path not working

 
Thread Tools Rate Thread
Old 19-06-2006, 08:23 PM   #1
Mike
Guest
 
Posts: n/a
Default Using a network path not working


Hi all, I have a vb.net program running as a service that uses a network
path to query a file.

If System.IO.File.Exists(fpath & "\" & filename)

Can anyone tell me why the above isn't working? When I place it in a none
service program it works fine.


Any help appreciated.


Thanks in advance.


  Reply With Quote
Old 19-06-2006, 08:31 PM   #2
Winista
Guest
 
Posts: n/a
Default Re: Using a network path not working

1. Check your full path?
2. When you installed service, did you specify your working folder? If you
didn't and you are relying on app relative path, then full path will anchor
from System32 folder.

Winista
http://www.universalshoppingmall.com


"Mike" <ward007@swbell.net> wrote in message
news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net...
> Hi all, I have a vb.net program running as a service that uses a network
> path to query a file.
>
> If System.IO.File.Exists(fpath & "\" & filename)
>
> Can anyone tell me why the above isn't working? When I place it in a none
> service program it works fine.
>
>
> Any help appreciated.
>
>
> Thanks in advance.
>



  Reply With Quote
Old 19-06-2006, 08:44 PM   #3
Mike
Guest
 
Posts: n/a
Default Re: Using a network path not working

I made sure everthing is there. It seems that network paths don't work when
the vb program is running as a serice. Is that true?

"Winista" <winista@gmail.com> wrote in message
news:OUw1Ud9kGHA.5036@TK2MSFTNGP02.phx.gbl...
> 1. Check your full path?
> 2. When you installed service, did you specify your working folder? If you
> didn't and you are relying on app relative path, then full path will
> anchor from System32 folder.
>
> Winista
> http://www.universalshoppingmall.com
>
>
> "Mike" <ward007@swbell.net> wrote in message
> news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net...
>> Hi all, I have a vb.net program running as a service that uses a network
>> path to query a file.
>>
>> If System.IO.File.Exists(fpath & "\" & filename)
>>
>> Can anyone tell me why the above isn't working? When I place it in a none
>> service program it works fine.
>>
>>
>> Any help appreciated.
>>
>>
>> Thanks in advance.
>>

>
>



  Reply With Quote
Old 19-06-2006, 09:49 PM   #4
Winista
Guest
 
Posts: n/a
Default Re: Using a network path not working

Under what user context service is running?

"Mike" <ward007@swbell.net> wrote in message
news:Y8Dlg.149520$F_3.125172@newssvr29.news.prodigy.net...
>I made sure everthing is there. It seems that network paths don't work when
>the vb program is running as a serice. Is that true?
>
> "Winista" <winista@gmail.com> wrote in message
> news:OUw1Ud9kGHA.5036@TK2MSFTNGP02.phx.gbl...
>> 1. Check your full path?
>> 2. When you installed service, did you specify your working folder? If
>> you didn't and you are relying on app relative path, then full path will
>> anchor from System32 folder.
>>
>> Winista
>> http://www.universalshoppingmall.com
>>
>>
>> "Mike" <ward007@swbell.net> wrote in message
>> news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net...
>>> Hi all, I have a vb.net program running as a service that uses a network
>>> path to query a file.
>>>
>>> If System.IO.File.Exists(fpath & "\" & filename)
>>>
>>> Can anyone tell me why the above isn't working? When I place it in a
>>> none service program it works fine.
>>>
>>>
>>> Any help appreciated.
>>>
>>>
>>> Thanks in advance.
>>>

>>
>>

>
>



  Reply With Quote
Old 19-06-2006, 09:53 PM   #5
W.G. Ryan - MVP
Guest
 
Posts: n/a
Default Re: Using a network path not working

Check the account the service is running as and make sure it has access to
the share. This is a common problem b/c if the permissions aren't there, it
will return false.

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/07...=books&v=glance
http://search.barnesandnoble.com/bo...735622779&itm=1
"Mike" <ward007@swbell.net> wrote in message
news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net...
> Hi all, I have a vb.net program running as a service that uses a network
> path to query a file.
>
> If System.IO.File.Exists(fpath & "\" & filename)
>
> Can anyone tell me why the above isn't working? When I place it in a none
> service program it works fine.
>
>
> Any help appreciated.
>
>
> Thanks in advance.
>



  Reply With Quote
Old 20-06-2006, 10:41 AM   #6
Patrice
Guest
 
Posts: n/a
Default Re: Using a network path not working

Always include the error message. As soon as something works in a regular
application but doesn't work in an ASP.NET application or a service, double
check permissions...

--
Patrice

"Mike" <ward007@swbell.net> a écrit dans le message de news:
8RClg.149493$F_3.65027@newssvr29.news.prodigy.net...
> Hi all, I have a vb.net program running as a service that uses a network
> path to query a file.
>
> If System.IO.File.Exists(fpath & "\" & filename)
>
> Can anyone tell me why the above isn't working? When I place it in a none
> service program it works fine.
>
>
> Any help appreciated.
>
>
> Thanks in advance.
>



  Reply With Quote
Old 23-06-2006, 06:00 PM   #7
Mike
Guest
 
Posts: n/a
Default Re: Using a network path not working

Thanks to all for the help. I changed the user for the service and it
worked. Thanks again.


"Patrice" <scribe@chez.com> wrote in message
news:ejytI3ElGHA.1260@TK2MSFTNGP05.phx.gbl...
> Always include the error message. As soon as something works in a regular
> application but doesn't work in an ASP.NET application or a service,
> double check permissions...
>
> --
> Patrice
>
> "Mike" <ward007@swbell.net> a écrit dans le message de news:
> 8RClg.149493$F_3.65027@newssvr29.news.prodigy.net...
>> Hi all, I have a vb.net program running as a service that uses a network
>> path to query a file.
>>
>> If System.IO.File.Exists(fpath & "\" & filename)
>>
>> Can anyone tell me why the above isn't working? When I place it in a none
>> service program it works fine.
>>
>>
>> Any help appreciated.
>>
>>
>> Thanks in advance.
>>

>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off