Solved

Caching of DB information in array's?

Posted on 1998-11-13
3
169 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
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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