ASP and session object (get type)

Discussion in 'ASP General' started by ASP.Confused, Jun 21, 2004.

  1. ASP.Confused

    ASP.Confused Guest

    I would like to be able to get the type of object that a session variable
    contains (for example, determine whether it is a string, integer, single
    precision floating point, ADODB.Recordset, etc...)

    I need to know this for a ASP <----> ASP.NET session management script I am
    writing. I would like to be able just to copy strings and numbers. I
    already have code that does this, but I don't want my script to blow up when
    it finds a recordset in the session object!

    Is there any easy way to detect the object type in ASP?
     
    ASP.Confused, Jun 21, 2004
    #1
    1. Advertising

  2. ASP.Confused

    James Baker Guest

    You're probably going to be told at least once in this thread that you
    shouldn't contain recordsets (or any objects) in a Session variable. I
    suspect there are better ways to solve the problem to begin with.


    "ASP.Confused" <anonymous@> wrote in message
    news:uly5%...
    > I would like to be able to get the type of object that a session variable
    > contains (for example, determine whether it is a string, integer, single
    > precision floating point, ADODB.Recordset, etc...)
    >
    > I need to know this for a ASP <----> ASP.NET session management script I

    am
    > writing. I would like to be able just to copy strings and numbers. I
    > already have code that does this, but I don't want my script to blow up

    when
    > it finds a recordset in the session object!
    >
    > Is there any easy way to detect the object type in ASP?
    >
    >
     
    James Baker, Jun 21, 2004
    #2
    1. Advertising

  3. ASP.Confused

    Chris Barber Guest

    http://www.haneng.com/FunctionSearch.asp?s=IsObject

    and

    http://www.haneng.com/FunctionSearch.asp?s=TypeName

    TypeName on an recordset = "Recordset" [I think]

    Try it and see what you get.

    Chris.

    "ASP.Confused" <anonymous@> wrote in message news:uly5%...
    I would like to be able to get the type of object that a session variable
    contains (for example, determine whether it is a string, integer, single
    precision floating point, ADODB.Recordset, etc...)

    I need to know this for a ASP <----> ASP.NET session management script I am
    writing. I would like to be able just to copy strings and numbers. I
    already have code that does this, but I don't want my script to blow up when
    it finds a recordset in the session object!

    Is there any easy way to detect the object type in ASP?
     
    Chris Barber, Jun 21, 2004
    #3
  4. ASP.Confused

    Mark Schupp Guest

    See the VBScript TypeName() function.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "ASP.Confused" <anonymous@> wrote in message
    news:uly5%...
    > I would like to be able to get the type of object that a session variable
    > contains (for example, determine whether it is a string, integer, single
    > precision floating point, ADODB.Recordset, etc...)
    >
    > I need to know this for a ASP <----> ASP.NET session management script I

    am
    > writing. I would like to be able just to copy strings and numbers. I
    > already have code that does this, but I don't want my script to blow up

    when
    > it finds a recordset in the session object!
    >
    > Is there any easy way to detect the object type in ASP?
    >
    >
     
    Mark Schupp, Jun 21, 2004
    #4
  5. Aaron [SQL Server MVP], Jun 21, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Smythe
    Replies:
    3
    Views:
    1,265
    Jeff Smythe
    Jan 2, 2004
  2. Replies:
    2
    Views:
    3,085
    silverfox_1188
    Aug 16, 2006
  3. momo898
    Replies:
    2
    Views:
    494
    bruce barker \(sqlwork.com\)
    Oct 12, 2006
  4. BillE
    Replies:
    0
    Views:
    468
    BillE
    Nov 8, 2006
  5. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,296
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
Loading...

Share This Page