try 2 : asp session ref to a global obj: Gurus Required

Ask a Question related to ASP, Design and Development.

  1. #1

    Default try 2 : asp session ref to a global obj: Gurus Required

    I'm sure that the following is possible, I just need a little help
    please.

    I have a object which I declare as a application object "gObj".

    I need to use "gObj" with all sessions. I need "gObj" to have access
    based on the user's id. Is this possible without creating multiple
    gObj's?

    Code would be something like:

    Application_OnStart
    set gobj = Server.Create( "someDll" )

    gobj.uname = "somename"
    gobj.port = 1234
    gobj.pwd = "pwd"
    End


    ASP page code:

    <%
    gobj.connect

    ' do stuff.
    %>

    So, what I want to do is:

    <%

    gobj.SelectUser( "userName" )
    'do stuff

    %>

    Without this causing problems with "userName2"

    <%

    'called at the same time
    gobj.SelectUser( "userName2" )

    %>

    Tough One Eh?

    Likely not possible?

    Thanks Gurus.

    Alex.
    Alex Guest

  2. Similar Questions and Discussions

    1. Problem with global.asa database and Session OnEnd
      Agggghhhh.... I've read countless posting and still can't get an answer that works. I'm trying to update a record when a session ends. Here's the...
    2. Global Error handling in Applicatio_Error() of Global.asax
      Hi all, For a web application if we are using web farm, and if i want to do Global Error handling can i use Applicatio_Error() method in...
    3. Hey layers gurus-need an eye here
      This is my first "real" attempt at using layers. www.billraydrums.com/7_19_03/new.htm Please take a look-see and give me some hints as to how...
    4. Creating session variables in GLOBAL.ASA ???
      Hey all In my GLOBAL.ASA file I'm trying to create a session variable for reference in the various webpages of my site.... Sub Session_OnStart...
    5. how to declare session variable in global.asax file
      please provide code sample, i was having trouble declaring interger and string variable and can we also initialize them at the same time thanks...
  3. #2

    Default Re: try 2 : asp session ref to a global obj: Gurus Required

    Alex wrote:
    > I'm sure that the following is possible, I just need a little help
    > please.
    >
    > I have a object which I declare as a application object "gObj".
    >
    Don't store COM objects in Application (or Session). Especially if they are
    ActiveX dll's created with VB. Instantiate the object on each page as
    needed. Only free-threaded objects should be stored in Application. VB dll's
    are apartment-threaded.

    [url]http://www.aspfaq.com/show.asp?id=2053[/url]

    HTH,
    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may 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