Invalid path or file name.

G

Guest

I have a major problem with trying to access a foxpro database from a web app.

I have created a web app which is deployed on a server. The foxpro database
(dbf) is on a different server. The access to the database is a shared path.

I hace tried everything the only options that seem to work ON THE WEB SERVER
ONLY is if I set the impersonate to true in the web.config file. This is fine
and works if I access the page using ie on the webserver BUT it fails with
the error "Invalid path or file name." when I try and access the page from
anyother machine.

It appears to be security issue. If I add a username and password (which I
do not want to do) in the web.config then I can access the shared database.

Please help.
 
S

Steven Cheng[MSFT]

Hi Saracen,

Thanks for your posting. From your description, you have a db file on a
remote machine which is exposed as a UNC shared, and you will access this
file in your asp.net application on another server. But you found the
accessing will faild unless you impersonate the asp.net under a DOMAIN
account, yes?

As for this problem, it's a normal security issue when acessing remote
resource in asp.net. When accessing a remote resource we need to let the
asp.net run under a certain account which is valid to the remote machine(
recognizable). What's your asp.net server's version? WIN2K (XP) OR
WIN2003? If it's a 2003 version, since the asp.net's default process
identity is NT AUTHORITY\NETWORKSERVICE which represent the server's domain
machine account (like domainName\machineName$) , so you can just grant the
access permission of the UNC shared folder (on the remote machine) to the
asp.net server's domainMachine account( domainName\machineName$).

If the asp.net server is not 2003, the default process account is a local
account named MACHINE\ASPNET which is not remotable so that the remote
access will fail. To workaround this , one means is just what you've
tried------- use a domain account to run(impersonate) the asp.net
application.
If you don't want to use domain account, you can also create two duplicated
local account(have the same username password) on both the two machines.
Then, let the asp.net run under that local account , when accessing the
remote machine, this account can be valid to the remote machine.
If there is anything unclear, please feel free to post here.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top