Solved

Caching of DB information in array's?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

19 Experts available now in Live!

Get 1:1 Help Now