User Authentication variable problem DW8 ASP VB

Posted on 2007-10-18
Last Modified: 2008-01-09

Can anyone see why I keep getting this error message, when it seems that the variable IS defined as "Admin":

Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'MM_authorizedUsers'
/MR07test/admin/add_product.asp, line 7

The code is:

' *** Restrict Access To Page: Grant or deny access to this page
If Session("MM_Username") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
End If

I have tried this several times but getting nowhere


Question by:swordfishsoup
    LVL 20

    Accepted Solution

    i guess you have set
    Option Explicit
    on top of page

    so define all variable befor you use them
    Dim MM_authorizedUsers, MM_authFailedURL
    so on

     and later you can use them

    Author Comment

    You guessed good!

    Thanks very much for your help

    Have a good evening

    LVL 20

    Expert Comment

    u r alway welcome :)

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now