Solved

Caching of DB information in array's?

Posted on 1998-11-13
3
186 Views
Last Modified: 2010-04-04
Hi,

I'm writing this program which much give the user a sort of graphical representation of a database (in a treeview). When the user want additional information I don't want to connect to the database again and get the information. I want as much information as possible gathered at startup when I initialize the representation. What is the best way to do this? Loading the tables in array's of records? Or memorytables? I don't know in front how many records will be processed, so if I use Array's I have to define them big enough. Can memory-problems arise then?
Anyway I need some tips. Maybe you want some more information, just ask.

Regards, Lizzzy.
0
Comment
Question by:lizzzard
[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
3 Comments
 
LVL 4

Expert Comment

by:dwwang
ID: 1346734
If you do not have the tree view completed yet, you can find BDTreeView on the internet. For caching the data, you can use InMemoryTables. See DbiCreateInMemTable in BDE32.Hlp.
0
 
LVL 1

Accepted Solution

by:
Gerhard100198 earned 100 total points
ID: 1346735
Lizzzard,

As for the Array/Record idea, I use it often to store info. With Delphi 4's new dynamic arrays this is very easy and very powerful. In a 32 bit environment you shouldn't easily run into memory problems but as a programmer I personally always try and avoid having "too much" in memory at any time.

I suggest you make use of a TQuery.

When using a TQuery you get back a result set (you can view this as almost a cached version of you data). You can set up your query to include all the possible info that you need. The advantage that you then have is that this info is browsable with all DataAware controls and that you have access to all this info at any time.

If you need any additional info on this method let me know.

Gerhard
gerhardvr@email.com
0
 

Author Comment

by:lizzzard
ID: 1346736
Gerhard,

Thank you for your suggestion, I didn't think of a solution based on a TQuery. I will certainly look into it wether it's suitable for my application. You'll hear from me as soon as possible,

Regards, Lizzzy
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

623 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