CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2007
    Posts
    6

    application settings/properties

    Hi,

    I have a old vb6 application I maintain,

    that has the settings in a separate xml file.

    But now I have to move those "inside" (to remove the xml, don't ask why ).

    What would be best place/"paradigm" for such

    settings to be handled in vb6 ?

    Like database connections, general parameters...

    Also to be easy to change it, u know what I mean.

    I just searched on the web but until now could not find it.

    Of course it is easy to hard code the ones for the moment

    but maybe is a better way.

    Regards,
    a

  2. #2
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    Re: application settings/properties

    In VB6 most of these kinds of settings would be placed in an .ini file or in the registry. You could equally store them in a resource file. Part of how you would do this can depend also on the application i.e. is it a stand alone app is it a 'layered' app with seperate components residing on different physical boxes.
    If you find my answers helpful, dont forget to rate me

  3. #3
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    Re: application settings/properties

    The XML File is not a lot different from an INI file (as you probably have discovered)

    I guess one reason you are being asked to move the settings from the XML is because an XML file can easily be read (which may compromise various security issues)

    Can I suggest that moving the settings either into a database table or into the registry may create its own set of issues, but is certainly a real alternative to XML

    However, have you considered leaving the data in the XML file and simply encrypting the file once the settings are made. Then all your program has to do is decrypt the file and away you go

    This will solve the security issue if thats what this is all about

    Search the forum on Encryption as this topic has been discussed at length, not too long ago

  4. #4
    Join Date
    Mar 2007
    Posts
    6

    Re: application settings/properties

    Actually the reasons for stop using the xml is pretty stupid:

    it is a big old application using lots of not supported 3d party dlls and not only dlls;

    there is a setup that does include the xml when run/installed, but of course the old xml.

    If I now add a new database connection in application and xml the xml will not be copied at new

    release and if 500 users get the new version of exe automatically they ain't going to get the new

    xml.

    And I cannot make the same setup because I have no idea of all the entities related, I tried but

    just didn't guessed it right.

    So I want to move the setting "inside" sort to speak and then at new release it will come

    together with the executable.

    I think best for my application is to put it in registry. Why not in a table?

    Because the user can connect to different databases, depending on the default one (from xml

    for now) it initial connects to that and then he can choose other dbs.

    Thanks guys.

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: application settings/properties

    I normally just use an ini file which is created at the first run of the software on the users pc using default values contained within the exe.

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

Featured