Web Development

General discussion

VBScript Error handling

I am writing a site using ASP 3.0 pages and VBScript. I am connecting to a SQL Server 2k database and running on a Windows 2k IIS server.I am using Windows security to log people in but need to know how to capture if a user hasn't got permission to the database and show an error page telling them they do not have permissions. I need to do this in the VBScript. How do I go about this?

All Comments

I am using ASP.NET technology but I was early ASP programmer too, may be it helps for you:

<%@ LANGUAGE = VBScript %><% Option Explicit %>

<!*************************This sample is provided for educational purposes only. It is not intended to be used in a production environment, has not been tested in a production environment, and Microsoft will not provide technical support for it. *************************>

it's too hard to uderstand, if you would like another way for checking permission of user and sending special message for him, you can simply use the possability of IIS identification. I hope that you know that are three ways: form, IIS and Windows Authentication. You can send me your letter and I can propouse myself manner for that - another from traditional bat also smart.

here is what you have to do. Use a testuser as your userid in windows and create one in your sql but dont have right to the database. Access the page you created and of course you will have an erro. Whis is an asp error or Transatsql error. Remember the error number. then rewrite you code with the ff. line inserted.

<%on error resume next this line or pff. lines your code to access the sql

if err.number = this is the number a while ago then Response.Write("No Access")end if

Start or search

Create a new discussion

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

Post type

Subject title

Topic Tags

Select up to 3 tags (1 tag required)

Cloud

Piracy

Security

Apple

Microsoft

IT Employment

Google

Open Source

Mobility

Social Enterprise

Community

Smartphones

Operating Systems

Windows

Mac

Malware

Tablets

Networking

Browser

Hardware

Software

Web Developerment

Linux

Off Topic

Message Body

Track this discussion and email me when there are updates

Please note: Do not post advertisements, offensive material, profanity, or personal attacks. Please remember to be considerate of other members. If you're new to the TechRepublic Forums, please read our TechRepublic Forums FAQ. All submitted content is subject to our Terms Of Use.