p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VS.NET 2002/2003 (http://p2p.wrox.com/forumdisplay.php?f=103)
-   -   Problem accessing folder on LAN (http://p2p.wrox.com/showthread.php?t=8395)

nikunjn January 21st, 2004 07:05 AM

Problem accessing folder on LAN
    i am new to ASP.NET.
i have created an application which needs to write to folder on other machine. I am a user on that machine and i am able to create files on that machine manually.
but i am not able to create it using the program.
Also what to do so that i can keep my database (mdb) on the other machine. i tried mapping a drive and giving the path but it gives an error that the path is invalid.
please help me out.

stu9820 January 21st, 2004 09:25 AM

How are you mapping the path? Try this:

\\machine_name\c$\folder_name\folder_name\database .mdb

planoie January 21st, 2004 10:16 AM

Even though YOU are permitted to access the network folder, your application may very well not be. ASP.net runs under its own user profile. For .net 1.0 the user account is "ASPNET" while in .net 1.1 the account is "IWAM_<machinename>". Both of these accounts are on the web server. So you would need to either change what account ASP.net runs under (configurable in IIS manager) or those accounts need to be granted access to the necessary network resources.

Work smarter, not harder.

nikunjn January 21st, 2004 10:17 AM

hi stu9820,
   Thanks for ur quick reply.I tried ur advice but still it give me the following error :
The Microsoft Jet database engine cannot open the file
'\\ip_address\d:\nikunj\dmt\dmt.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
I have given all the permissions to my login-id for this folder on the machine. what else has to be done?

nikunjn January 21st, 2004 10:31 AM

hi planoie,
   my question may be very basic but i am new to this stuff.
how do i change the account ASP.net under which it runs. I had apprehended the issue of rights when transfering my database to other machine but could not make out how to give the IWAM_<machinename> user on my machine the right on some other machine as it is not a login id on LAN.
Can i make IIS run under my lan id so that the same rights apply to it as i have manually on that resource.
thanks & Regards,

planoie January 21st, 2004 10:45 AM

I would not recommend setting up ASP.net to run under your account. You should either create a network account for it to run under or just provide the right permissions to the current account. I just tried that on my machine and it seems you can't grant permissions on one machine to a local account on a different machine. So perhaps your best bet is to have your network admin create a domain based account for ASP.net, and you can use that. In IIS you can change the account that the application runs as under the "Directory Security" tab of the website properties.

Alternatively, you could grant access to "everyone" for that folder, but you probably don't want to do that.

Work smarter, not harder.

pgtips January 21st, 2004 10:58 AM


I just tried that on my machine and it seems you can't grant permissions on one machine to a local account on a different machine.
I know nothing about ASP.NET, but for classic ASP what you do is create an identical local account on the remote machine (i.e same user name and same password).

Creating a domain account and using that instead is also a perfectly valid way to solve the problem.


pgtips January 21st, 2004 11:17 AM

Just one problem with setting up an identical local account on the remote machine - how to find out the password of the existing ASPNET or IWAM_machineName users!

I've seen a script before that recovers the IWAM password, but I haven't been able to find it again.

(I didn't think of this prob when I originally posted because I never use the default accounts, I always set up a new local account for my ASP pages - so I always know the password!)


planoie January 21st, 2004 11:22 AM

In IIS you can change it so that IIS doesn't generate the password for the account, so you should be able to manually set a password. Then you can just duplicate that as phil has suggest earlier.

Work smarter, not harder.

pgtips January 21st, 2004 11:27 AM

Found the script to recover IWAM details. Paste this into a VBS file and run it.

Option Explicit
Dim WebServiceObj, WamUserName, WamUserPass

' Get a reference to the web service object
set WebServiceObj = GetObject("IIS://LocalHost/w3svc")

' Save the wam user name and password
WamUserName = WebServiceObj.WAMUserName
WamUserPass = WebServiceObj.WAMUserPass

' echo to screen
WScript.Echo WamUserName
WScript.Echo WamUserPass

All times are GMT -4. The time now is 03:16 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.