0

I am working on a windows app. The user has to register first to use this application. So in order to store user information, I am using MS-Access as a database. There is not much information to be stored as this application will be on individuals machine. There are few settings and some user information to be stored.

What I am feeling is that with the use of MS-Access, my application will be dependent on other application as MS-Access. It is not necessary to have the MS-office on the end user's machine.

So can you suggest me the best way to store the data safely without any dependence.

One thing I want to clear is that, the information will be of different types like it will consists of user information, some folder/files paths and some other information. I would like to keep these information separate from each other.

Thanks Abhie

Deepak Kumar
  • 672
  • 4
  • 15
  • 31

3 Answers3

1

I think I found the solution.

Best practice to save application settings in a Windows Forms Application

I hope this will help others facing same problem.

Stackoverflow Team You are doing fabulous job. One suggestion; can you put some chat option for developers to discuss their problems. I think this would make it more easy to find answers to complex problems...:)

Regards

Community
  • 1
  • 1
Deepak Kumar
  • 672
  • 4
  • 15
  • 31
0

you need to include Access Database Engine drivers in the client PC, in order to connect it .

MS Access Database Engine

Ravi Gadag
  • 15,735
  • 5
  • 57
  • 83
  • yes, I understand this, I'll keep it as last option as this will be a kind of dependency. So I want some safe and reliable way of doing this. – Deepak Kumar Feb 06 '12 at 05:24
0

If you're using .NET, the best bet for getting the recommended folder locations for application data (e.g. your mdb file) is probably best retrieved using Environment.GetFolderPath

See: http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx

You're likely interested in ApplicationData or LocalApplicationData for user specific data or CommonApplicationData for data shared by all users as your storage location (and then the proper company / product subdirectories appended to it).

userx
  • 3,769
  • 1
  • 23
  • 33
  • The problem is not about storing the db files but to use of database or something else. This app will be on individual user's machine. So no concept of multiple users applied here. – Deepak Kumar Feb 06 '12 at 05:27
  • @Deepak - Could you please further clarify what you're asking then? It seemed as if you were looking for info on where to store user files. Whether it is a MDB file, a user specific XML file, etc. I believe that my answer is WHERE you should be storing it. Are you asking HOW you should be saving it? (e.g. MS Access alternatives for relational data) – userx Feb 06 '12 at 05:32
  • Sorry if I am not clear about my question. I want to know that what is the best approach to store user + some other important information. Whether I should save it in the database or there is some other best option available in visual studio. For example, I can go for XML files or registry entries. But I am afraid of the permissions issues. – Deepak Kumar Feb 06 '12 at 05:36
  • @Deepak - Well files stored in `ApplicationData` or `LocalApplicationData` should be read-write for the user itself (and not other users under most setups) as is the `HKEY_CURRENT_USER` registry key. That's their point. Some applications use the My Documents folder. Without knowing what KIND of data you're storing, it's really hard to say, but few applications are going to require an Access database for user settings storage. In most cases, a simple xml (or ini, although outdated) config file is probably going to be sufficient. I'd recommend updating your question as appropriate :) – userx Feb 06 '12 at 05:41