Professional Web Applications Themes

Virtual Directories and ASP Session Var - ASP

make sure session state is enabled in the virtual directory properties (configuration button on virtual directory tab). -- Mark Schupp Head of Development Integrity eLearning [url]www.ielearning.com[/url] "Sharon" <beall2llnl.gov> wrote in message news:29dd01c386d0$5f98b9f0$a001280aphx.gbl... > IIS 5 on Win 2000. First time I'm using a virtual > directory, pointing to another drive on the same machine. > > I have a directory listing asp script that shows for each > item in the directory: thumbnail, filename, date created, > size, etc.... > > ASP script works fine when it resides within/under > wwwroot. It does not work when it resides within the ...

  1. #1

    Default Re: Virtual Directories and ASP Session Var

    make sure session state is enabled in the virtual directory properties
    (configuration button on virtual directory tab).

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Sharon" <beall2llnl.gov> wrote in message
    news:29dd01c386d0$5f98b9f0$a001280aphx.gbl...
    > IIS 5 on Win 2000. First time I'm using a virtual
    > directory, pointing to another drive on the same machine.
    >
    > I have a directory listing asp script that shows for each
    > item in the directory: thumbnail, filename, date created,
    > size, etc....
    >
    > ASP script works fine when it resides within/under
    > wwwroot. It does not work when it resides within the
    > actual directory that the virtual is pointing to. The
    > message I get is:
    >
    > Microsoft VBScript runtime error '800a01f4'
    > Variable is undefined: 'Session'
    > /DocRoot/DirList.asp, line 49
    >
    > Related lines:
    > Dim objRS
    > Set objRS = Server.CreateObject("ADODB.Recordset")
    >
    > Line 49 is:
    > Set Session("myRS") = objRS
    >
    > ? Sharon

    Mark Schupp Guest

  2. #2

    Default Re: Virtual Directories and ASP Session Var

    I checked that having found a Q article, I think 244465 with a similar
    suggestion.

    It is checked with timeout of 20 minutes in the "parent web directory"
    and through all "child directories".
    I specifically looked at the virtual directory Configuration and it is
    checked there too.

    :(

    Any more ideas?



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Sharon Beall Guest

  3. #3

    Default Re: Virtual Directories and ASP Session Var

    Does the following statement cause the same error if in the page all by
    itself:

    Session("hello")="world"

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Sharon Beall" <beall2llnl.gov> wrote in message
    news:%23UbvGZwhDHA.1932TK2MSFTNGP11.phx.gbl...
    > I checked that having found a Q article, I think 244465 with a similar
    > suggestion.
    >
    > It is checked with timeout of 20 minutes in the "parent web directory"
    > and through all "child directories".
    > I specifically looked at the virtual directory Configuration and it is
    > checked there too.
    >
    > :(
    >
    > Any more ideas?
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Mark Schupp Guest

  4. #4

    Default Re: Virtual Directories and ASP Session Var

    I tried putting
    Session("hello") = "world"
    and the results are similar:

    Microsoft VBScript runtime error '800a01f4'
    Variable is undefined: 'Session'
    /DocRoot/DirList.asp, line 50


    I tried putting it with Set like Set Session("hello") = "world"
    But same error message.

    I'm thinking of asking that they move the virtual directory under the
    real web root unless there is a major reason to keep it out....I'm also
    having issues with the search engine trying to look at another drive.

    But if you think of anything else, I'll gladly try it! Are there some
    ASP libraries that may need copied to the virtual directory maybe?
    Maybe it can't find the appropriate references or something. I dunno.

    Perplexed :),
    Sharon

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Sharon Beall Guest

  5. #5

    Default Re: Virtual Directories and ASP Session Var

    "Sharon Beall" <beall2llnl.gov> wrote in message
    news:ObZsF6CiDHA.1872TK2MSFTNGP10.phx.gbl...
    > I tried putting
    > Session("hello") = "world"
    > and the results are similar:
    >
    > Microsoft VBScript runtime error '800a01f4'
    > Variable is undefined: 'Session'
    > /DocRoot/DirList.asp, line 50
    >
    >
    > I tried putting it with Set like Set Session("hello") = "world"
    > But same error message.
    >
    > I'm thinking of asking that they move the virtual directory under the
    > real web root unless there is a major reason to keep it out....I'm also
    > having issues with the search engine trying to look at another drive.
    >
    > But if you think of anything else, I'll gladly try it! Are there some
    > ASP libraries that may need copied to the virtual directory maybe?
    > Maybe it can't find the appropriate references or something. I dunno.
    Very bizarre. There shouldn't be anything special you need to do to get
    that to work.

    --
    Tom Kaminski IIS MVP
    [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running IIS
    [url]http://mvp.support.microsoft.com/[/url]
    [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]



    Tom Kaminski [MVP] Guest

  6. #6

    Default Re: Virtual Directories and ASP Session Var

    Do you have access to look at the virtual directory properties yourself? The
    only thing that I know of that would cause that error would be if sessions
    are not enabled for your virtual directory. Other than that I would suspect
    a corrupted IIS installation.

    Note: the SET statement is used only to assign an object to a variable, it
    is not necessary for intrinsic types like strings.
    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Sharon Beall" <beall2llnl.gov> wrote in message
    news:ObZsF6CiDHA.1872TK2MSFTNGP10.phx.gbl...
    > I tried putting
    > Session("hello") = "world"
    > and the results are similar:
    >
    > Microsoft VBScript runtime error '800a01f4'
    > Variable is undefined: 'Session'
    > /DocRoot/DirList.asp, line 50
    >
    >
    > I tried putting it with Set like Set Session("hello") = "world"
    > But same error message.
    >
    > I'm thinking of asking that they move the virtual directory under the
    > real web root unless there is a major reason to keep it out....I'm also
    > having issues with the search engine trying to look at another drive.
    >
    > But if you think of anything else, I'll gladly try it! Are there some
    > ASP libraries that may need copied to the virtual directory maybe?
    > Maybe it can't find the appropriate references or something. I dunno.
    >
    > Perplexed :),
    > Sharon
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Mark Schupp Guest

  7. #7

    Default Re: Virtual Directories and ASP Session Var

    FWIW, if sessions were not allowed the symptom would be that the
    variable/value would not persist from page to page. It's completely strange
    that the error is instead "Variable is undefined: 'Session'".

    Hmmm, maybe she needs a "Dim Session("hello")" because she's using "Option
    Explicit"?

    --
    Tom Kaminski IIS MVP
    [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running IIS
    [url]http://mvp.support.microsoft.com/[/url]
    [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]

    "Mark Schupp" <mschuppielearning.com> wrote in message
    news:u%23Ec%236DiDHA.604TK2MSFTNGP10.phx.gbl...
    > Do you have access to look at the virtual directory properties yourself?
    The
    > only thing that I know of that would cause that error would be if sessions
    > are not enabled for your virtual directory. Other than that I would
    suspect
    > a corrupted IIS installation.
    >
    > Note: the SET statement is used only to assign an object to a variable, it
    > is not necessary for intrinsic types like strings.
    > --
    > Mark Schupp
    > Head of Development
    > Integrity eLearning
    > [url]www.ielearning.com[/url]
    >
    >
    > "Sharon Beall" <beall2llnl.gov> wrote in message
    > news:ObZsF6CiDHA.1872TK2MSFTNGP10.phx.gbl...
    > > I tried putting
    > > Session("hello") = "world"
    > > and the results are similar:
    > >
    > > Microsoft VBScript runtime error '800a01f4'
    > > Variable is undefined: 'Session'
    > > /DocRoot/DirList.asp, line 50
    > >
    > >
    > > I tried putting it with Set like Set Session("hello") = "world"
    > > But same error message.
    > >
    > > I'm thinking of asking that they move the virtual directory under the
    > > real web root unless there is a major reason to keep it out....I'm also
    > > having issues with the search engine trying to look at another drive.
    > >
    > > But if you think of anything else, I'll gladly try it! Are there some
    > > ASP libraries that may need copied to the virtual directory maybe?
    > > Maybe it can't find the appropriate references or something. I dunno.
    > >
    > > Perplexed :),
    > > Sharon
    > >
    > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > > Don't just participate in USENET...get rewarded for it!
    >
    >

    Tom Kaminski [MVP] Guest

  8. #8

    Default Re: Virtual Directories and ASP Session Var

    I do have Option Explicit turned on.
    I tried adding a Dim Session("hello") and it says this:

    Expected integer constant
    /DocRoot/DirList.asp, line 50
    Dim Session("hello")
    ------------^


    I tried commenting out the Option Explicit, and it WORKED! I can see my
    directory listing with thumbnails.

    Still don't know *why*, but ok.

    Sharon


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Sharon Beall Guest

  9. #9

    Default Re: Virtual Directories and ASP Session Var

    I haven't been following this thread, but like, what's going on with that
    dim statement?

    Are you trying to dim a session variable? You don't have to do that.

    Are you trying to dim an array? If so, you have to dim it like:
    Dim YourArray(3)

    That is why it is telling you it's expecting an integer content. It thinks
    that you are trying to dim an array, which expects a numeric value in the
    parenthesis if you'd like to declare the size.

    Ray at work

    "Sharon Beall" <beall2llnl.gov> wrote in message
    news:OzU05pPiDHA.2120TK2MSFTNGP10.phx.gbl...
    > I do have Option Explicit turned on.
    > I tried adding a Dim Session("hello") and it says this:
    >
    > Expected integer constant
    > /DocRoot/DirList.asp, line 50
    > Dim Session("hello")
    > ------------^
    >
    >
    > I tried commenting out the Option Explicit, and it WORKED! I can see my
    > directory listing with thumbnails.
    >
    > Still don't know *why*, but ok.
    >
    > Sharon
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Ray at Guest

  10. #10

    Default Re: Virtual Directories and ASP Session Var

    "Sharon Beall" <beall2llnl.gov> wrote in message
    news:OzU05pPiDHA.2120TK2MSFTNGP10.phx.gbl...
    > I do have Option Explicit turned on.
    > I tried adding a Dim Session("hello") and it says this:
    >
    > Expected integer constant
    > /DocRoot/DirList.asp, line 50
    > Dim Session("hello")
    > ------------^
    >
    >
    > I tried commenting out the Option Explicit, and it WORKED! I can see my
    > directory listing with thumbnails.
    >
    > Still don't know *why*, but ok.
    What happens if you just use "Dim Session" (with Option Explicit enabled)?

    --
    Tom Kaminski IIS MVP
    [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running IIS
    [url]http://mvp.support.microsoft.com/[/url]
    [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]



    Tom Kaminski [MVP] Guest

  11. #11

    Default Re: Virtual Directories and ASP Session Var

    Ray,

    You're totally right...that was just an idea on how to deal with an
    (existing) problem, but commenting out Option Explicit makes it work.

    The original reason for the thread:

    'Related lines:
    Dim objRS
    Set objRS = Server.CreateObject("ADODB.Recordset")
    'Line 49 is:
    Set Session("myRS") = objRS

    Gives error:
    Variable is undefined: 'Session'
    /DocRoot/DirList.asp, line 49

    [the Allow Sessions is turned on for the entire webserver, AND the
    virtual directory explicitly ]

    Thanks!
    Sharon

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Sharon Beall Guest

  12. #12

    Default Re: Virtual Directories and ASP Session Var

    PLEASE READ THIS: [url]http://www.aspfaq.com/2053[/url]

    Ray at work

    "Sharon Beall" <beall2llnl.gov> wrote in message
    news:%23xdbA8RiDHA.2212TK2MSFTNGP09.phx.gbl...
    > Set Session("myRS") = objRS

    Ray at Guest

  13. #13

    Default Re: Virtual Directories and ASP Session Var

    Sharon Beall wrote:
    > Ray,
    >
    > You're totally right...that was just an idea on how to deal with an
    > (existing) problem, but commenting out Option Explicit makes it work.
    >
    > The original reason for the thread:
    >
    > 'Related lines:
    > Dim objRS
    > Set objRS = Server.CreateObject("ADODB.Recordset")
    > 'Line 49 is:
    > Set Session("myRS") = objRS
    >
    Nobody has given you the standard spiel about storing COM objects in
    Session?? Take a look at this:
    [url]http://www.aspfaq.com/show.asp?id=2053[/url]

    Bob Barrows


    Bob Barrows Guest

Similar Threads

  1. Remove need for Virtual Directories
    By Robio in forum Coldfusion Server Administration
    Replies: 2
    Last Post: November 27th, 06:28 PM
  2. Virtual Directories?
    By Purple Haze in forum PHP Development
    Replies: 4
    Last Post: September 29th, 02:36 PM
  3. virtual directories and IIS
    By Ali in forum ASP.NET Web Services
    Replies: 1
    Last Post: November 26th, 04:52 AM
  4. Replies: 2
    Last Post: July 30th, 07:00 PM
  5. Replies: 2
    Last Post: July 9th, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139