Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Destroy cached variable from com component

Status
Not open for further replies.

harmmeijer

Programmer
Mar 1, 2001
869
CN
I have a com component Author that has 2 functions:
getAuthor (gets a string wich contains a list of the authors)
updAuthor (updates the authors table in the pubs database)

The aspx page calling the getAuthor function (in the page load) does it like this:
strAuthorlist = Cache("strAuthorlist")
If strAuthorlist Is Nothing Then
' generate a new instance of authors
objAuthors = New Authors.clsauthors()
Cache("strAuthorlist") = objAuthors.getAuthor
objAuthors = nothing
End If
strAuthorlist = Cache("strAuthorlist")

The strAuthorlist will be used in the aspx page, the first time the com component is called, the com component is started wich gets data from the server and puts in in a nice html text string. The next time the page is requested the textstring is taken out of the memory, no com component is created and no database bothered.
Problem is when the updAuthor is called the data will change, this component has to destroy the Cache("strAuthorlist") variable so the next time a list is needed it will be re created.

Question:
How do I destroy this Cached variable from my com component??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top