Solved

Creating Memory resident DLL in VB6

Posted on 2002-05-15
9
472 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
Industry Leaders: 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month3 days, 17 hours left to enroll

630 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