ASP/Perl website FSO method fails to locate file since migrating from Win2k server to shared hosting

Since migrating from windows 2000 to shared windows hosting environment failed website functioning. Is it permissions or the code that needs to change. Unfortunately if it is permissions I have no control because this is a shared hosting environment.  If the code is the problem what can I replace it with?  

The code that fails without error - i have been able to determine the  fso.FileExists( SaleRecord ) = False but can't determine why.  Code follows:

'open the text file
	' Instantiate a FileSystem Object
      Set fso = CreateObject( "Scripting.FileSystemObject" )

      ' SaleRecord path must be modified to reflect the file 
      ' structure of the server
      SaleRecord = "C:\inetpub\wwwroot\DWeb\SaleItems\" & _

      ' Check if the file exists, if not create it
      If fso.FileExists( SaleRecord ) = True Then

      ' Open the SaleRecord and create the entry 
        Set tso = fso.OpenTextFile( SaleRecord, 1, false )
with Response
			line = tso.readline            'strip header line
			while not tso.AtEndOfStream
				line = trim(tso.readLine)
				line = right(line,len(line)-1)
				for i = 0 to 6
					pos = Instr(line,"@")
					items(i) = left(line,pos-1)
					line = right(line, len(line) -(pos+2))
				 items(7) = left(line,len(line)-1)
				.Write tr 
				for i = 0 to 7
					.Write td & items(i) & tdend
				.Write trend
		 end with
        Call tso.Close()
        set tso = nothing  
	  end if   'file exist   
	  set fso = nothing

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Shared hosting is not usually at "C:\inetpub\wwwroot\".  You have to find the actual path your shared hosting uses to get to your site.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
>   ' Check if the file exists, if not create it

You are also going to need to change the permissions on the folder where you are accessing this in order to create or delete files.  The iuser needs write permissions.

If you have issues with your hosting, try another.   I used to use newtek.   Their legacy plans have full support for classic asp and you can easily change permissions to folders.
Big MontySenior Web Developer / CEO of Commented:
try changing

SaleRecord = "C:\inetpub\wwwroot\DWeb\SaleItems\sales.txt"


SaleRecord = Server.MapPath("/SaleItems/sales.txt")

this assumes there's a folder off your root called SalesItems. The Server.MapPath function will translate the virtual path to the physical path, so assuming the file exists, that should work.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rivaramaAuthor Commented:
RE: Path:  I posted the original code for simplicity.  

Monty, The command worked perfectly!  Thanks so much!
rivaramaAuthor Commented:
Learning ASP on the fly!  Thanks for a simple solution. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.