Error Displyaing Session Variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry

    Error Displyaing Session Variables

    I'm using this code:

    Dim strName
    For Each strName in Session.Content s
    Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
    Next

    If I only do a response.write strName, it shows all the session names
    but when I include the session.content s it gives me the following
    error:

    Microsoft VBScript runtime error '800a01c2'

    Wrong number of arguments or invalid property assignment

    I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
    using ADODB.Recordset but I'm not accessing data on this page.

    Any ideas why this is happening?

    Thanks,

    --
    Jerry

  • Mike Brind

    #2
    Re: Error Displyaing Session Variables


    Jerry wrote:
    I'm using this code:
    >
    Dim strName
    For Each strName in Session.Content s
    Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
    Next
    >
    If I only do a response.write strName, it shows all the session names
    but when I include the session.content s it gives me the following
    error:
    >
    Microsoft VBScript runtime error '800a01c2'
    >
    Wrong number of arguments or invalid property assignment
    >
    I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
    using ADODB.Recordset but I'm not accessing data on this page.
    >
    Any ideas why this is happening?
    >


    --
    Mike Brind

    Comment

    • Jerry

      #3
      Re: Error Displyaing Session Variables


      Mike Brind wrote:
      Jerry wrote:
      I'm using this code:

      Dim strName
      For Each strName in Session.Content s
      Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
      Next

      If I only do a response.write strName, it shows all the session names
      but when I include the session.content s it gives me the following
      error:

      Microsoft VBScript runtime error '800a01c2'

      Wrong number of arguments or invalid property assignment

      I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
      using ADODB.Recordset but I'm not accessing data on this page.

      Any ideas why this is happening?
      >
      http://www.aspfaq.com/show.asp?id=2524
      Thanks Mike.

      I tried the example and I get the following error:

      Microsoft VBScript runtime error '800a01f4'

      Variable is undefined: 'Item'

      So I added Dim Item and I get the original error messgae again:

      Microsoft VBScript runtime error '800a01c2'

      Wrong number of arguments or invalid property assignment

      --
      Jerry

      Comment

      • Anthony Jones

        #4
        Re: Error Displyaing Session Variables


        "Jerry" <jerryalan@gmai l.comwrote in message
        news:1153495052 .244538.82790@7 5g2000cwc.googl egroups.com...
        >
        Mike Brind wrote:
        Jerry wrote:
        I'm using this code:
        >
        Dim strName
        For Each strName in Session.Content s
        Response.Write strName & " - " & Session.Content s(strName) &
        "<BR>"
        Next
        >
        If I only do a response.write strName, it shows all the session names
        but when I include the session.content s it gives me the following
        error:
        >
        Microsoft VBScript runtime error '800a01c2'
        >
        Wrong number of arguments or invalid property assignment
        >
        I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
        using ADODB.Recordset but I'm not accessing data on this page.
        >
        Any ideas why this is happening?
        >
        http://www.aspfaq.com/show.asp?id=2524
        >
        Thanks Mike.
        >
        I tried the example and I get the following error:
        >
        Microsoft VBScript runtime error '800a01f4'
        >
        Variable is undefined: 'Item'
        >
        So I added Dim Item and I get the original error messgae again:
        >
        Microsoft VBScript runtime error '800a01c2'
        >
        Wrong number of arguments or invalid property assignment
        >
        --
        Jerry
        >
        The code you have posted is correct assuming that Session and Response are
        what we think they are and it is this code that is actually producing the
        error and not something else.

        Which version of IIS are we talking about?






        Comment

        • Jerry

          #5
          Re: Error Displyaing Session Variables


          Anthony Jones wrote:
          "Jerry" <jerryalan@gmai l.comwrote in message
          news:1153495052 .244538.82790@7 5g2000cwc.googl egroups.com...

          Mike Brind wrote:
          Jerry wrote:
          I'm using this code:

          Dim strName
          For Each strName in Session.Content s
          Response.Write strName & " - " & Session.Content s(strName) &
          "<BR>"
          Next

          If I only do a response.write strName, it shows all the session names
          but when I include the session.content s it gives me the following
          error:

          Microsoft VBScript runtime error '800a01c2'

          Wrong number of arguments or invalid property assignment

          I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
          using ADODB.Recordset but I'm not accessing data on this page.

          Any ideas why this is happening?

          >
          http://www.aspfaq.com/show.asp?id=2524
          Thanks Mike.

          I tried the example and I get the following error:

          Microsoft VBScript runtime error '800a01f4'

          Variable is undefined: 'Item'

          So I added Dim Item and I get the original error messgae again:

          Microsoft VBScript runtime error '800a01c2'

          Wrong number of arguments or invalid property assignment

          --
          Jerry
          >
          The code you have posted is correct assuming that Session and Response are
          what we think they are and it is this code that is actually producing the
          error and not something else.
          >
          Which version of IIS are we talking about?
          IIS 5.1

          If I remove the session(Item) part, it will list the session names.

          Dim Item
          For Each Item in Session.Content s
          Response.Write Item & "<BR>"
          Next

          Comment

          • Bob Barrows [MVP]

            #6
            Re: Error Displyaing Session Variables

            Jerry wrote:
            I'm using this code:
            >
            Dim strName
            For Each strName in Session.Content s
            Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
            Next
            >
            If I only do a response.write strName, it shows all the session names
            but when I include the session.content s it gives me the following
            error:
            >
            Microsoft VBScript runtime error '800a01c2'
            >
            Wrong number of arguments or invalid property assignment
            >
            I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
            using ADODB.Recordset but I'm not accessing data on this page.
            >
            Any ideas why this is happening?
            >
            Thanks,
            I've never used Session.Content s, but it should work. This is what I always
            do:

            For Each strName in Session
            Response.Write strName & " - " & Session(strName ) & "<BR>"
            Next


            Anyways, if you create a page containing only the snip of code you've posted
            above, will the error occur?

            --
            Microsoft MVP - ASP/ASP.NET
            Please reply to the newsgroup. This email account is my spam trap so I
            don't check it very often. If you must reply off-line, then remove the
            "NO SPAM"


            Comment

            • Jerry

              #7
              Re: Error Displyaing Session Variables


              Bob Barrows [MVP] wrote:
              Jerry wrote:
              I'm using this code:

              Dim strName
              For Each strName in Session.Content s
              Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
              Next

              If I only do a response.write strName, it shows all the session names
              but when I include the session.content s it gives me the following
              error:

              Microsoft VBScript runtime error '800a01c2'

              Wrong number of arguments or invalid property assignment

              I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
              using ADODB.Recordset but I'm not accessing data on this page.

              Any ideas why this is happening?

              Thanks,
              >
              I've never used Session.Content s, but it should work. This is what I always
              do:
              >
              For Each strName in Session
              Response.Write strName & " - " & Session(strName ) & "<BR>"
              Next
              >
              >
              Anyways, if you create a page containing only the snip of code you've posted
              above, will the error occur?
              Yes, an ASP page with only the following:
              <%
              Dim Item
              For Each Item in Session.Content s
              Response.Write Item & " - " & Session(Item) & "<BR>"
              Next
              %>
              produces the same error.

              If I remove the .Contents then I get the following error:
              Microsoft VBScript runtime error '800a01b6'
              Object doesn't support this property or method
              /trs/test.asp, line 3

              Comment

              • Mike Brind

                #8
                Re: Error Displyaing Session Variables


                Jerry wrote:
                Bob Barrows [MVP] wrote:
                Jerry wrote:
                I'm using this code:
                >
                Dim strName
                For Each strName in Session.Content s
                Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
                Next
                >
                If I only do a response.write strName, it shows all the session names
                but when I include the session.content s it gives me the following
                error:
                >
                Microsoft VBScript runtime error '800a01c2'
                >
                Wrong number of arguments or invalid property assignment
                >
                I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
                using ADODB.Recordset but I'm not accessing data on this page.
                >
                Any ideas why this is happening?
                >
                Thanks,
                I've never used Session.Content s, but it should work. This is what I always
                do:

                For Each strName in Session
                Response.Write strName & " - " & Session(strName ) & "<BR>"
                Next


                Anyways, if you create a page containing only the snip of code you've posted
                above, will the error occur?
                >
                Yes, an ASP page with only the following:
                <%
                Dim Item
                For Each Item in Session.Content s
                Response.Write Item & " - " & Session(Item) & "<BR>"
                Next
                %>
                produces the same error.
                >
                If I remove the .Contents then I get the following error:
                Microsoft VBScript runtime error '800a01b6'
                Object doesn't support this property or method
                /trs/test.asp, line 3
                Try:

                Dim x
                For Each x in Session.Content s
                Response.Write x & " - " & Session(x) & "<BR>"
                Next
                %>

                Just a theory, but Item is a keyword in VBScript. That might be the
                cause of the error.

                --
                Mike Brind

                Comment

                • Jerry

                  #9
                  Re: Error Displyaing Session Variables


                  Mike Brind wrote:
                  Jerry wrote:
                  Bob Barrows [MVP] wrote:
                  Jerry wrote:
                  I'm using this code:

                  Dim strName
                  For Each strName in Session.Content s
                  Response.Write strName & " - " & Session.Content s(strName) & "<BR>"
                  Next

                  If I only do a response.write strName, it shows all the session names
                  but when I include the session.content s it gives me the following
                  error:

                  Microsoft VBScript runtime error '800a01c2'

                  Wrong number of arguments or invalid property assignment

                  I've been to http://www.aspfaq.com/show.asp?id=2373 and it talks about
                  using ADODB.Recordset but I'm not accessing data on this page.

                  Any ideas why this is happening?

                  Thanks,
                  >
                  I've never used Session.Content s, but it should work. This is what I always
                  do:
                  >
                  For Each strName in Session
                  Response.Write strName & " - " & Session(strName ) & "<BR>"
                  Next
                  >
                  >
                  Anyways, if you create a page containing only the snip of code you've posted
                  above, will the error occur?
                  Yes, an ASP page with only the following:
                  <%
                  Dim Item
                  For Each Item in Session.Content s
                  Response.Write Item & " - " & Session(Item) & "<BR>"
                  Next
                  %>
                  produces the same error.

                  If I remove the .Contents then I get the following error:
                  Microsoft VBScript runtime error '800a01b6'
                  Object doesn't support this property or method
                  /trs/test.asp, line 3
                  >
                  Try:
                  >
                  Dim x
                  For Each x in Session.Content s
                  Response.Write x & " - " & Session(x) & "<BR>"
                  Next
                  %>
                  >
                  Just a theory, but Item is a keyword in VBScript. That might be the
                  cause of the error.
                  Same error. I was initially using strName instead of Item but saw Item
                  in an example.

                  --
                  Jerry

                  Comment

                  • Bob Barrows [MVP]

                    #10
                    Re: Error Displyaing Session Variables

                    Jerry wrote:
                    >>
                    >Anyways, if you create a page containing only the snip of code
                    >you've posted above, will the error occur?
                    >
                    Yes, an ASP page with only the following:
                    <%
                    Dim Item
                    For Each Item in Session.Content s
                    Response.Write Item & " - " & Session(Item) & "<BR>"
                    Next
                    %>
                    produces the same error.
                    >
                    If I remove the .Contents then I get the following error:
                    Microsoft VBScript runtime error '800a01b6'
                    Object doesn't support this property or method
                    /trs/test.asp, line 3
                    I was just able to reproduce your error by using:
                    for each key in session.Content s
                    Response.Write "<BR>" & key & ": " & session.content s(key)
                    next

                    The error went away when I changed it to:
                    for each key in session.Content s
                    Response.Write "<BR>" & key & ": " & session(key)
                    next



                    --
                    Microsoft MVP - ASP/ASP.NET
                    Please reply to the newsgroup. This email account is my spam trap so I
                    don't check it very often. If you must reply off-line, then remove the
                    "NO SPAM"


                    Comment

                    • Jerry

                      #11
                      Re: Error Displyaing Session Variables


                      Bob Barrows [MVP] wrote:
                      Jerry wrote:
                      >
                      >
                      Anyways, if you create a page containing only the snip of code
                      you've posted above, will the error occur?
                      Yes, an ASP page with only the following:
                      <%
                      Dim Item
                      For Each Item in Session.Content s
                      Response.Write Item & " - " & Session(Item) & "<BR>"
                      Next
                      %>
                      produces the same error.

                      If I remove the .Contents then I get the following error:
                      Microsoft VBScript runtime error '800a01b6'
                      Object doesn't support this property or method
                      /trs/test.asp, line 3
                      >
                      I was just able to reproduce your error by using:
                      for each key in session.Content s
                      Response.Write "<BR>" & key & ": " & session.content s(key)
                      next
                      >
                      The error went away when I changed it to:
                      for each key in session.Content s
                      Response.Write "<BR>" & key & ": " & session(key)
                      next
                      Thanks Bob, I'll try that Monday morning and see how it works!

                      --
                      Jerry

                      Comment

                      • Jerry

                        #12
                        Re: Error Displyaing Session Variables


                        Bob Barrows [MVP] wrote:
                        Jerry wrote:
                        >
                        >
                        Anyways, if you create a page containing only the snip of code
                        you've posted above, will the error occur?
                        Yes, an ASP page with only the following:
                        <%
                        Dim Item
                        For Each Item in Session.Content s
                        Response.Write Item & " - " & Session(Item) & "<BR>"
                        Next
                        %>
                        produces the same error.

                        If I remove the .Contents then I get the following error:
                        Microsoft VBScript runtime error '800a01b6'
                        Object doesn't support this property or method
                        /trs/test.asp, line 3
                        >
                        I was just able to reproduce your error by using:
                        for each key in session.Content s
                        Response.Write "<BR>" & key & ": " & session.content s(key)
                        next
                        >
                        The error went away when I changed it to:
                        for each key in session.Content s
                        Response.Write "<BR>" & key & ": " & session(key)
                        next
                        Sorry for the delayed response. This does not work either.

                        --
                        Jerry

                        Comment

                        Working...