Solved

Caching of DB information in array's?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

28 Experts available now in Live!

Get 1:1 Help Now