Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating Memory resident DLL in VB6

Posted on 2002-05-15
9
Medium Priority
?
481 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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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

916 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