Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 5th, 2005, 11:44 AM
Authorized User
Points: 333, Level: 6
Points: 333, Level: 6 Points: 333, Level: 6 Points: 333, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Fresno, California, USA.
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Classic VBScript GetFolder() method

Hey all,

Been writing C++ for years and C# for a year now. Currently helping my boss get his asp page going that he developed from a different region. On the page is a documents library that uses vbscript to run it. It uses the objFolder.GetFolder() object to get the folder headers. It has one variable you store the base folder in and it goes through a series of loops building paths deeper up to 4 levels. This solution was originally developed for the filde shares to be on the same machine as the app server, different drive though. We are deploying it here and has the files located on a different server as a share than the application server. I am using UNC paths now instead of drive letters. I am getting the error in the code that it can't locate folder for the GetFolder() method. It works in our test environment but the files are on the same drive as the server. We found out it is a permissions thing but don't know what permissions to assign where for the app server to be able to have the permissions to list the directories.
So the questions I have is:
In classic asp what account does the app server use when accessing folders via objFolder.GetFolder() object method?

This is in an active directory domain. 1 domain, 1 forest, don't seem to see the app server's account IUSR_(servername) in AD anywhere either but it is present on the app server.
  #2 (permalink)  
Old October 5th, 2005, 11:48 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

By default, a classic ASP page runs under IUSR_MachineName which is a *local* account so it doesn't have any network rights.

Check out this FAQ for a solution:

http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=276

You may also want to read this FAQ to determine if IUSR_MachineName is indeed the right account to use:

http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=287

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old October 5th, 2005, 01:36 PM
Authorized User
 
Join Date: Sep 2004
Location: , , USA.
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or, is it a clien-side vs. server side codes thing?

"...developed for the filde shares to be on the same machine as the app server" using vbscript, and now, "....We are deploying it here and has the files located on a different server as a share than the application server".

HTH.




  #4 (permalink)  
Old October 5th, 2005, 02:33 PM
Authorized User
Points: 333, Level: 6
Points: 333, Level: 6 Points: 333, Level: 6 Points: 333, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Fresno, California, USA.
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, it is server vs server ultimately as that is the issue we are having it with. We are currently setting up in our test environment another much with just xp Pro on it to function as a file location for testing and we are going to try and authenticate method. I do know in our live environment using authentication isn't working. Something may not be passing on the user's credentials. Funny thing they are mine and I have admin access to everything.

This code is not mine and it took me awhile to decipher as I am not nearly proficient in VB as I am in C#/C++.

If you are wondering how we are going to expand off this page. Everything new being developed in in ASP.NET(C#). Once I get a test machine up we are going to test it in our test environment and see if it works there. Might be something quirky in the domain.
  #5 (permalink)  
Old October 5th, 2005, 03:22 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Is the ASP page running under the context of IUSR_MachineName (with anonymous access) and you're trying to access files remotely?

Or do you have a different setup? Is your account "trusted for delegation"?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #6 (permalink)  
Old October 5th, 2005, 09:06 PM
Authorized User
Points: 333, Level: 6
Points: 333, Level: 6 Points: 333, Level: 6 Points: 333, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Fresno, California, USA.
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

We actually switched it to windows suthentication and had me access the site. I have admin access on the app server and filesharing server. My account is a domain account. Still having issues with the object accessing the folder. This is one of the most headache things about web app development. Permissions the accounts the app assumes. Let me make sure I get this right. With windows authentication selected on my site, you have to have a domain account to access the site and the app uses that user's credentials for access to other resources? If I have anonymouse on, the app server will use the name and account in the box below but for it to be able to access the fileshare server I would need to create a local account duplicate to that on the IIS server on the FS server and grant it rights to the share?

  #7 (permalink)  
Old October 6th, 2005, 01:24 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If you're talking about classic ASP only, that's about right. (For ASP.NET things are different).

In the anonymous case, you can either copy the IUSR_MachineName account to the FS and give an explicit password to this account on both machines. You could also create a brand new (domain) account and use that.

However, there is also something called "delegation", which may be what's causing your problems. Does the file server itself have shares you try to access? That is, are more than two machines involved? By default, an account used on IIS can access the FS, but cannot go beyond that machine, unless the account is trusted for delegation and kerberos is used.

You may want to read this for more details about the different concepts: http://msdn.microsoft.com/library/de...entication.asp

It's targeted at ASP.NET, but the concepts apply to ASP as well.

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #8 (permalink)  
Old June 5th, 2006, 07:56 PM
Authorized User
Points: 333, Level: 6
Points: 333, Level: 6 Points: 333, Level: 6 Points: 333, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Fresno, California, USA.
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought I should get back to you Imar to let you know the issue back then was delegation. Never heard of that before until then. had to go a different approach for our shares since our director does want them on shares seperate than the app server and our security team doesn't do delegation accounts hehe.

  #9 (permalink)  
Old June 6th, 2006, 12:54 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Thanks for the update.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Classic Asp to Asp.Net 2.0 vikaspatyal ASP.NET 2.0 Professional 2 October 7th, 2007 06:33 PM
asp.net vs classic asp "URGENT" naeem_ul_hussan Classic ASP Professional 1 August 1st, 2007 03:14 PM
classic asp with asp.net on same iis bostonrose .NET Framework 2.0 6 January 10th, 2007 12:38 PM
Accessing a VBA module's method from VBScript hamffjs Access VBA 3 November 28th, 2006 09:27 AM
(GetFolder) and Trusted Domains JGargas Classic ASP Basics 1 May 26th, 2006 06:04 PM





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