Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing history (not in db)

Status
Not open for further replies.

simplyJ

MIS
Jul 12, 2001
59
US
I am trying to figure out how I would make a vb application that would store user's selections into memory. What would be the best way to do this? I don't want the users to need any db program like Access. If at all possable I would love for them to be able to save everything into a file within the same directory as my executable, so they can transfer the info to mulitple computers.

Can anyone send me to a site or tell me how to store the information in such a way?
 
'Why not do what you say you want? Open a file, save the data, and close file.???????????
 
I have never done this before. I would love to just do it, but I don't know what format I need it in, what type of file to use, etc...

Is there any place to look for information on how to do this?
 
One approach is well documented in the ".INI" files There are even API calls set up specifically for that format. Look up "INI" or "Initalization" in many places. Ms. has generally turned away from this approach in favor of the registry, so support for the INI API calls may not last more than a few more years, but it should be long enough to get your project done. There are also API calls to copy registry sections/entries deom installation discs to registries which could accomplish the end point goal (Individual set up for your app) but these do not meet the criteria of simply copying a directory (Folder) from machine to machine.

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Thank you for the suggestion.

If Microsoft does turn away from this style completey, would my program work on future versions of Windows? Don't mean to bombard you with questions, but I really don't want to have to redo this again and again.
 
SimplyJ

I have a couple of classes for VB that allow you to save & fetch settings from the registry. The first was downloaded from the net somewhere (don't know the source to give credit too, as I got it from another...). The second is a wrapper for that class that can be set up to define all the settings to retrieve/set. The disadvantage to using the registry approach is you don't have one file that you can copy from machine to machine... although you can export & import registry trees.

Let me know if you want the VB class code.

Stuart
seasterbrook@hydro.mb.ca
 
VB itself supports GetSetting and SaveSetting which you can use to save/restore values to the registry. Unfortunately, it stores them in an unfriendly place

HKEY_CURRENT_USER\Software\VB and VBA Program Settings

Another alternative is to use the NTSVC control (get it from the MS website) which can save and restore settings to anywhere in the registry, and also allows you to log events.

Unfortunately, neither of these allows multiple users to have the same configuration. The only way I know how to do this would be to write the settings to a file (maybe an ini file) which is located on a share and allow all users access to that share.

Chaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top