Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 21st, 2004, 07:05 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem accessing folder on LAN

hi,
    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.
regards,
Niks
Reply With Quote
  #2 (permalink)  
Old January 21st, 2004, 09:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
Thanks: 0
Thanked 3 Times in 3 Posts
Default

How are you mapping the path? Try this:

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

Reply With Quote
  #3 (permalink)  
Old January 21st, 2004, 10:16 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
  #4 (permalink)  
Old January 21st, 2004, 10:17 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #5 (permalink)  
Old January 21st, 2004, 10:31 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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,
Niks.
Reply With Quote
  #6 (permalink)  
Old January 21st, 2004, 10:45 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
  #7 (permalink)  
Old January 21st, 2004, 10:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:
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.

hth
Phil
Reply With Quote
  #8 (permalink)  
Old January 21st, 2004, 11:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

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!)

rgds
Phil
Reply With Quote
  #9 (permalink)  
Old January 21st, 2004, 11:22 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
  #10 (permalink)  
Old January 21st, 2004, 11:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Found the script to recover IWAM details. Paste this into a VBS file and run it.
Code:
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem deleting folder in Session_OnEnd Sowee Classic ASP Basics 3 March 9th, 2007 07:18 AM
Wake on Lan perecarl VBScript 1 January 18th, 2007 04:03 AM
Making a folder virtual folder on button click in CsharpHelp C# 0 October 26th, 2005 05:57 AM
view server folder problem? cslimcom Classic ASP Databases 4 December 21st, 2004 10:08 PM
Update Problem under wwwroot folder theokrtz Classic ASP Databases 4 June 8th, 2004 07:29 AM



All times are GMT -4. The time now is 08:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.