|
-
Nov 7th, 2001, 09:34 AM
#1
Thread Starter
Lively Member
what is advantage to write to registry
Why we want to write to registry. We can just build a table in database and track each user's info. But I saw a lot of program try to write to registry? Can anyone explain? Thanks
-
Nov 7th, 2001, 09:47 AM
#2
Typically because its simpler
Back in the olden days, program settings were stored in .ini files that were read in, either by a programmer-developed roputine, or API calls to read INI's.
Then came the registry...a giant store of information that can be shared and is located in a single place.
With databases, especially file based one's like Access, etc...,you have to worry about connectivity, speed, syntax, LOCATION. What if some ID 10 T decides he wants to delete/move some files and ends up deleting a crucial file. What are the odds that same ID 10 T is going to find an entry in the registry, much less have a reason for deleting it?
If we're talking really complex data, then yes, it probably should be in some sort of supporting file, but if we're talking simple data, then the eregistry is the way to go.
-
Nov 7th, 2001, 09:49 AM
#3
Thread Starter
Lively Member
Thanks, so you mean if we use SQL database, it can easily accomplish same. The only advantage to use registry is simple.
Am I correct?
-
Nov 7th, 2001, 09:52 AM
#4
Fanatic Member
I'm sure that you will get more in depth and technical answers to why you should write to registry.
But on a practical level, an example would be:
When you write a program that requires a File Open dialog box, it is handy sometimes to have the default folder to be the last folder browsed, regardless wether the program has been shut down or not (something VB6 doesn't do itself, funily enough!). Writing this directory string to the registry means you can hold it there until your program is rerun and the FileOpen dialog box opened again.
Now, as it is only one string, it is not worth creating a database. You could use a text file. or ini file, but why have an extra file?
-
Nov 7th, 2001, 09:53 AM
#5
Registery is great because most of common user do not go check in registery so you can put some variable value there to save them. Of course, it's not a good place to put big text.
-
Nov 7th, 2001, 09:55 AM
#6
Fanatic Member
Originally posted by Mark_Meng
Thanks, so you mean if we use SQL database, it can easily accomplish same. The only advantage to use registry is simple.
Am I correct?
Well, yes is the answer. You may also be working in an environment where administers don't like developers messing with the registry, so SQLServer would do (but would be theoretically slower)
-
Nov 7th, 2001, 10:06 AM
#7
Black Cat
The registry should be used for configuration data, or simple data you just need to grab or save. Use a (relational) database for structured, organized data you wish to sort or search. Use XML files for something in between.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Nov 7th, 2001, 10:12 AM
#8
Gaffer is quite correct about the simple aspect, but some other main reasons for the using the registry:
You can store bits of information on a per-user basis You dont need to keep track of the user
It's fairly idiotproof
And as Gaffer mentioned, you can use SaveSetting & GetSetting in VB to this kind of thing. You don't necessarily have to use the Registry api calls, unless you need to get fancy.
It's fast, and doesn't require any external files, networks, servers.
It's hidden from most users
Disadvantage - it doesn't follow a user from machine to machine if he changes PC's during the day, and you're doing stuff on a per-user basis
-
Nov 7th, 2001, 10:55 AM
#9
Thread Starter
Lively Member
I think I got it. Thanks very much, I really appreciate
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|