Results 1 to 5 of 5

Thread: Saving Information

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600
    Greetings all.

    In VB, there are many ways to save program data, e.g. in a database like Access or SQL, a text file, INI Files or the Registry, etc.

    Can someone please give some basic guidelines on when to use which method? Which is more efficient and better at insuring the integrity of the data? Also, which method is better when it comes to installing apps? For example, if you use ADO rather than some other method, will the overall installation of the app be larger because of the additional runtime files needed?

    Thanks for your input.

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    Hi OneSource! Just some of my opinions here.

    I do not like using text or .ini files to store anything other than error logs or other small, easy to handle data. A database such as Access or SQL or even a simple database such as Excel provides a much easier way of handling and managing the data when developing the program. Imagine if you used a text file with 70,000 records and you need to look for a particular record to see exactly how it is appearing in the DB. You would waste a lot of time.

    I do believe (although someone correct me if I am wrong ) that using ADO will make the application size larger. Other methods such as DAO are simpler to use and require less space, but they have their drawbacks. In a program that I have just finished, I decided that it will be the last one that I develop using DAO and I will use ADO from now on. The reason is that my program that I just finished can only be used with an Access database, and I can't sell it to a client who wants a database in Oracle ADO provides the greater flexibility.

    Other folks, please pitch in here?

    Andrew

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Thanks DrewDog...

    Anyone else have any thoughts? By the way, DrewDog, you didn't mention your thoughts about saving to the Registry.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hi there!

    In VB there are many ways, but in qbasic (wich i leaved a half decade ago), you just have to do everything manually. So after much experience with saving data in my own formats, for instance .dsf and .tos, i never had any need for use of databases or the registry. Storing your data manually does not neccesarily mean the txt and ini writing. Opening files in random will give fast access and customization is unlimited. I use databases when i need, and that is when i have to. About the registry thing:
    Not recommended. If you need to save the window size or any other tiny info, it's an option but still I use it only if there is nothing else to store. Also small singleexefile programs can be easyer to transport if they don't have any annoying inifiles around.
    Ini files are recommended when you write a program that handles the inifile as a script, that you can change easily notepad

  5. #5
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    here are my thoughts:

    don't use registry - too complicated
    don't use databases - bad (i don't like them)1
    use a file
    Code:
    Open "c:\myfile.txt" For Output As #1
    Write #1, "My name is David", "VB-World Rules"
    Close #1
    that is a quick method, for saving data,and it doesn't use much space

    databases are probably better?

    this is just my 2 cents
    or as Serge says: My $0.02

    [Edited by da_silvy on 03-18-2000 at 04:03 AM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width