Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,I am trying to read data from a server on our network using VFPOLEDB.1 however I am getting an error:

"Invalid path or file name"

which is caused by a permissions issue.

I have tried using the impersonate in web.config file and also set the application pool account in IIS to admin credentials but still getting the error.

This worked fine when I was debugging using my local machine as host but when debugging using IIS it gave me the error.

I have also tried to use my my own domain accounts in the IIS server 'mydomain\myaccount' but still doesnt work, it should work because I can access the server folder from my pc.

I have checked what account it is running under by using the below code and it is the correct account:
<%= System.Security.Principal.WindowsIdentity.GetCurrent().Name%>

//connection string I am using .
@"Provider=VFPOLEDB.1;Data Source=//Servername/Folder/Folder/Folder/VFP.DBC;Collating Sequence=MACHINE"


Can anyone point me in the right direction please?

Many thanks
Posted
Updated 7-Dec-14 23:43pm
v5
Comments
Kornfeld Eliyahu Peter 8-Dec-14 5:37am    
You can not resolve a permission issue from code - ask your IT why there is no permission for you to access that location...
DHicks19 8-Dec-14 5:42am    
I know, the problem is my domain account does have access rights to the folder on the server which is why I can access it from my pc. When giving IIS the same account credentials it fails.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900