Solved

Creating Memory resident DLL in VB6

Posted on 2002-05-15
9
454 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now