• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 703
  • Last Modified:

FSO -Need to trap - Permission Denied

Hi ,
Im using FSO to naviagte via web page to our shared drive.. However when a user doesnt have access to a file/folder i get:

Microsoft VBScript runtime error '800a0046'
Permission denied

/drive/default.asp, line 71


Anyway to trap this in asp?

Cheers!
0
stephengriffin
Asked:
stephengriffin
  • 7
  • 3
  • 2
1 Solution
 
cb1393Commented:
<%
On Error Resume Next
'-------------------------------------
'ERROR-TRIGGERING CODE HERE
'-------------------------------------
MyErrorNumber = Err.Number
MyErrDescription = Err.Description
%>
0
 
stephengriffinAuthor Commented:
what error number and description should i get for "permission denied"
 im getting :

ERROR Number0 and Description

code ive put on page is :

On Error Resume Next
'-------------------------------------
'ERROR-TRIGGERING CODE HERE
'-------------------------------------
MyErrorNumber = Err.Number
MyErrDescription = Err.Description

RESPONSE.WRITE "ERROR Number" & MyErrorNumber &" and Description " & MyErrDescription

I want to say to users:

Access is denied , click "here " to submit a request for access....


If they get access denied...

0
 
cb1393Commented:
1) You need to put "On Error Resume Next" at the top of the page, or at least before line 71.
2) You need to put the following two lines somewhere after line 71:

MyErrorNumber = Err.Number
MyErrDescription = Err.Description

After these two lines, you should then be able to access the error number and description (when there is one).

Sorry if it was confusing. The following is only a placeholder for the part of the code that is giving you problems. It doesn't do anything:

-------------------------------------
'ERROR-TRIGGERING CODE HERE
'-------------------------------------
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
stephengriffinAuthor Commented:
Hi Cb , thanks for that.  I have a little vbscript experience alright so understand the commented information , but should I expect a particular error number for "permission denied" or using "on Error resume next" does this "pipe" all errors into a zero value?
0
 
cb1393Commented:
No, if you get an error, it will give you an error number. Receiving a 0 means the error wasn't trapped or there was no error.

Didn't mean to be presumptuous about your coding knowledge... sorry about that.
0
 
stephengriffinAuthor Commented:
No problem about being presumptuous :-) I dont exactly come across has having a clue do I ? :-)

Problem is that when i use the code you have me , i dont get anything other than a zero for error number where as before I got permission denied.. which im trying to trap.....
0
 
stephengriffinAuthor Commented:
Hi Masirof...

I expect permission denied for the folders that my users dont have access to in the first place so this is good :-) but I want to show them a "friendlier" error with a link for them to actually request acess..

So its not actually a problem that i get the error which your links point to...

Cheers!
0
 
stephengriffinAuthor Commented:
anymore ideas here guys? cheers!
0
 
masirofCommented:
If I got your right, you want to show more friendlier error messege to users.
You may want to edit Internal Error - 500-100 error page and customize it.
You can find it on Custom Errors tab on IIS.

Ask if unsure.
0
 
stephengriffinAuthor Commented:
I thought there may be a way to trap the error number for "access denied" instead of editing the Error Web Pages.

0
 
stephengriffinAuthor Commented:
I dont get an iis error page , i get :

Microsoft VBScript runtime error '800a0046'
Permission denied

/drive/default.asp, line 71
0
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.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 7
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now