Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Caching of DB information in array's?

Posted on 1998-11-13
3
Medium Priority
?
192 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 200 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

721 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