Passing COM objects between pages

Results 1 to 3 of 3

Thread: Passing COM objects between pages

  1. #1
    Nair Guest

    Default Passing COM objects between pages

    Is there any way i can pass COM objects between pages<BR><BR>This is what i want to do<BR>Eg. I have an ASP page Login.asp<BR>which calls the program ResultLogin.asp<BR>in resultLogin.asp<BR>i have<BR>dim PQR<BR>set PQR = server.createobject("objABC.OBJABC")<BR>PQR.load ("username","Passwd",PQR)<BR><BR><BR>now PQR contains<BR>PQR.FNAME<BR>PQR.LNAME<BR>etc, etc<BR><BR>This Resultlogin.asp redirects the page to say<BR>common.htm.<BR>I would like to access the PQR object there <BR>is there any way i can do that<BR><BR>I am not a good ASP programmer, could any one help me with examples<BR><BR>Thanks<BR>

  2. #2
    Pattabhi Guest

    Default RE: Passing COM objects between pages

    You can acheive this by creating the COM objects with session scope and can acess it from other pages.

  3. #3
    Join Date
    Dec 1969

    Default Probably a very bad idea....

    *ONLY* if your COM objects are "both" threaded should you ever do this. I&#039;m not even sure that you can create VB components that are "both" threaded, so you may be limited to those written in C++. (But others may know more on this.)<BR><BR>Anyway, you *can* store an object in a Session variable value. Just do<BR><BR>&#060;%<BR>Set Session("whatever") = yourObj<BR>%&#062;<BR><BR>In general, though, it&#039;s a bad idea unless you are being really careful to remove the objects (by assigning "nothing" to the Session variable value, for example) as soon as you get to the redirected-to page. be fair, if you *do* remove the objects immediately, then maybe it wouldn&#039;t hurt to use an apartment threaded component, since the "redirect" will stay in the same thread by default, anyway. <BR><BR>Well, let&#039;s just say it&#039;s a bad idea, in general. If you must try it, be careful.<BR><BR>

Posting Permissions

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