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

A

Alex

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.
 
B

Bob Barrows

Alex said:
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.

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

HTH,
Bob Barrows
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top