Results 1 to 4 of 4

Thread: saving data directly within VB app?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Hi,

    this may be a dumb question but...

    When you create a VB application which allows the end user to save different options or preferences as to how certain functions should operate, is it possible to save the information directly to the VB app or do you have to tie a database to it in order to be able to save the user settings?

    I would tend to think that it is the later because you probably can't alter an app that's been compiled but at the same time, it seems over kill to tie a database to an application just to save 1 or 2 user settings..

    Any help would be appreciated..

    Dan

  2. #2
    Junior Member
    Join Date
    Feb 2000
    Location
    Gig Harbor, WA, USA
    Posts
    25
    If you mean actually modifying the data in the app's .exe, why would you want to? Save your settings to the registry or an ini file. There should never be a reason to modify the .exe, and you really shouldn't.
    (¯`·.¸¸.·´¯`·->Cromas<-·´¯`·.¸¸.·´¯)
    Teenage Programmer
    Formerly known as ShadowCrawler

    E-Mail: [email protected]
    ICQ: 9872708
    AIM: VotchOut

  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    The easiest way is to just save values into the registry. There are APIs that can do this for you (if you wish to save a number of different types), but the easiest way is to use the built in registry functions found in VB. They would look like this:

    Code:
    'Set a registry value
               [app name] [section]  [key]    [string value]
    SaveSetting "App1", "Section1\Settings", "Settings", "user"
    [string]          [app name]  [section]  [key]
    sValue = GetSetting("App1", "Section1\Settings", "Settings")
    Or you could save values into an ini file. For info on that, just search vbworld. They have a decent registry/ini module that you can use.

    Hope this helps.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Great, thanks for the help guys!!! I just needed someone to point me in the right direction.. I figured there had to be a better way than having to tie a database to the app.. I had totally forgotten about INIs and Registry..

    Thanks again,

    Dan

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