Solved

Creating Memory resident DLL in VB6

Posted on 2002-05-15
9
461 Views
Last Modified: 2011-09-20
Hi Guys,
Is that possible to create a memory resident COM+ DLL in VB6. I want to cache a Oracle table data(Static data) in webserver. This component will be called by other components frequenlty and I don't want this component to access database each time.
I am using ADO and I don't want to do any file handling(persisting data in XML or something).
Or
Is there any possibility to share the ADO Recordset object created on that component to various instances of that component?

Any help or sample code will be highly appreciated.
0
Comment
Question by:sxmahesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7010777
I believe yes.
But you have to put all global declaration on module so that it can be shared by each instant.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7010782
One more thing, are you running windows 2000 or xp, You have to add your component to com+ and set the server process shutdown to 'leave running when idle' on property page
0
 

Author Comment

by:sxmahesh
ID: 7010795
If you do a global declaration in Module, the object will be created for for each instances isn't it?

I am running Win2000 Advance server.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:EDDYKT
ID: 7010800
You can check before you create

ie
if conn is nothing then
  do your connection and open database etc
end if
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 7010974
In my opinion all COM+ components should be stateless (object pooling and so on)

why not keep this specific DLL out of COM+ and share its data with your other components?

>> you do a global declaration in Module, the object will be created for for each instances isn't it ?
Yes, you cannot share data between different instances of a VB DLL unless you use something like memory mapped files or so (DLL's have a common code segment, but only if their base adresses are equal, but the have their own data segment).
0
 

Author Comment

by:sxmahesh
ID: 7010996
Hello Guys,

Thanks a lot for your answers. But found a way now.
It suddenly striked me why not to use ASP Application varibale to store the object.
I am using ASP Application scope variable in COM+. First time when the MSDTC is restarted, it will fetch the records and for the following instances just take the recordset object from Application variable. Cool isn't it?

Thanks a lot once again.

Cheers
Mahesh
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7011022
>>Yes, you cannot share data between different instances of a VB DLL unless you use something like memory
mapped files or so (DLL's have a common code segment, but only if their base adresses are equal, but
the have their own data segment).


I believe it is true if and only if your dll is not in com+
If you add your component in com+ you can set your dll run as server application on activation tab.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7765564
sxmahesh, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7838282
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question