473,511 Members | 17,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Settings: table lookup vs keep table open vs load into variables

What do experienced programmers find the most efficient way to handle
user settings.

Currently I have 4 tables which allow various clients to customize my
program to work for them, tblAcademicSettings (fields),
tblBillingsettings (32 fields), tblGraphical (23 fields), tblOwner (33
fields).

There is one record for each table. Admittedly, some of the fields
never change once set up, but many are there to allow the user to make
later changes in how the program works for him.

Til now, I do lookups every time I need info from one of the tables.
Definitely slow, and often causes "Can't open any more databases".
Clearly a better method is needed.

Before I start running benchmarks, I'm hoping folks here can weigh in
on their preferences.

Can I just open all these tables & keep 'em open?
Am I better off setting up public variables and loading the table info
into them all on load of the Switchboard? I will, of course, need to
update the variables any time the forms with this info are changed, but
I'd have to do that with open tables as well.

Or, should I store these values in my own folder in the Registry? Is
this risky?
Or, is there a better way?

Jun 18 '06 #1
3 1917
pe***********@aol.com wrote:
What do experienced programmers find the most efficient way to handle
user settings.

Currently I have 4 tables which allow various clients to customize my
program to work for them, tblAcademicSettings (fields),
tblBillingsettings (32 fields), tblGraphical (23 fields), tblOwner (33
fields).

There is one record for each table. Admittedly, some of the fields
never change once set up, but many are there to allow the user to make
later changes in how the program works for him.

Til now, I do lookups every time I need info from one of the tables.
Definitely slow, and often causes "Can't open any more databases".
Clearly a better method is needed.

Before I start running benchmarks, I'm hoping folks here can weigh in
on their preferences.

Can I just open all these tables & keep 'em open?
Am I better off setting up public variables and loading the table info
into them all on load of the Switchboard? I will, of course, need to
update the variables any time the forms with this info are changed, but
I'd have to do that with open tables as well.

Or, should I store these values in my own folder in the Registry? Is
this risky?
Or, is there a better way?


I always consider what needs to survive an update of the FE application. The settings that
need to be preserved after an update will usually go into an .INI file since I don't like
using registry settings if possible. Registry entries are an alternate and have some pros
and cons (users don't usually accidentally delete them but an .ini file can be but without
a professional uninstall program you could leave those registry entries behind after an
install, i.e. your app doesn't do proper housekeeping, etc).

I recommend reading them in at startup via a class that holds your "global" values. That
class would be updated by your code any time your user changes some type of settings
value. Whether the class reads/writes from a table, the registry or an .ini file is up to you.

There would only be one instance of the class and any updates would change the instance's
properties. Any code that needs to know a user setting queries the instance of the class.

--
'---------------
'John Mishefske
'---------------
Jun 18 '06 #2
All of them of course.
I've got arrays and collections for really speed
critical things, used by functions called from
queries, and lots of functions that will return
the previous value if called with the same parameters.

I've got open recordsets for some big tables that
are less critical and more complex.

I've got DLookups for a few things that are rarely
used.

I've got GetSetting and SaveSetting for things like
MRU list and menu settings.

I don't recommend using a list of unique variables,
it's to easy to loose the values. My arrays and
collections allow me to re-initialise if I have an
error. Other people use objects for the same reason.

(david)

<pe***********@aol.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.com...
What do experienced programmers find the most efficient way to handle
user settings.

Currently I have 4 tables which allow various clients to customize my
program to work for them, tblAcademicSettings (fields),
tblBillingsettings (32 fields), tblGraphical (23 fields), tblOwner (33
fields).

There is one record for each table. Admittedly, some of the fields
never change once set up, but many are there to allow the user to make
later changes in how the program works for him.

Til now, I do lookups every time I need info from one of the tables.
Definitely slow, and often causes "Can't open any more databases".
Clearly a better method is needed.

Before I start running benchmarks, I'm hoping folks here can weigh in
on their preferences.

Can I just open all these tables & keep 'em open?
Am I better off setting up public variables and loading the table info
into them all on load of the Switchboard? I will, of course, need to
update the variables any time the forms with this info are changed, but
I'd have to do that with open tables as well.

Or, should I store these values in my own folder in the Registry? Is
this risky?
Or, is there a better way?

Jun 20 '06 #3
Excellent answer.
Jun 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2070
by: Marc Walgren | last post by:
Greetings I have an ASP application to enter reservations. There are multiple user security settings that require some users to have a restricted list of client in a drop list on a form. I...
2
3069
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing...
1
2569
by: Old Timer | last post by:
I wish to type in a number in my "Code" field, for instance 1060, I then wish the number 1060 to trigger an event that will fill in the next field (township field) For instance, 1060 brings up and...
2
2506
by: Ravi | last post by:
Hi, I am working on a winform app. I need to use an object which can store some information(key/value pairs) and also can be acessed by multiple threads(read/write). From what I heard Hash table...
3
2414
by: jbsfe | last post by:
I have "Spilt" my database and the "lookup" and "seek" methods that previously worked, no longer do. I have learnd from reviewing the posts that the "lookup" and "Seek" methods cannot be used on...
4
5474
by: andy.mcvicker | last post by:
Hi Gang I have a large VB program that at one point does a lookup to a small table (26 rows by 3 columns). With this table I have to do some counting and retrieval of data. I'm finding that...
5
12641
by: Andrus | last post by:
I'm creating a database Winforms application using VCS Express 2005 I have some large lookup tables (may be up to 500000 records) which contains name and id and are stored in sql server. I...
33
11809
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
13
3222
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.