Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to hide database
 

How to hide database

-------------------------------------------------------------------

Development tool: Visual Studio 2005

Language: Visual Basic .NET

ISSUE: Package database into program

-------------------------------------------------------------------

DETAILS:

I have a windows forms application that uses an Access Database. I am new to windows forms applications, so there is still a LOT for me to learn.

Currently the only way I can figure out how to map out the connection string for the database is to place the file on the users C: drive in the program folder of the application. So my connection string looks like "C:\Program Files\MyApplication\access_db\MyDB.mdb"

Then when I create the setup and deploy on an "end-user" machine, the setup creates that directory and places the file in that folder.

I am used to web development and we have the luxury of using "Server.MapPath("MyDB.mdb")" to create a dynamic connection to the database.

How can I package this database into the .exe and make it so that when the user installs the program, they cannot dig into their Program Files folder and get to the database? It is pretty important that the users cannot find thier way to this data.

-----------------------------------------------------------------

Your help is appreciated,

KJAK

kjak  Friday, December 08, 2006 2:05 PM

bump...

Please... anybody that can help me with this?

kjak  Thursday, December 14, 2006 12:44 PM

Well, first of all, if securing the data is a high priority I'd recommend against using Access databases. My experience with them, which goes back to 1.0 days, is that they're difficult to secure reliably and are easy for users to get their hands on for whatever reasons they might have. You might want to consider other options if you can.

But, to get to your question, you can use My.Application.Info.DirectoryPath to get the directory where your application is located. You may also use My.Computer.FileSystem.SpecialDirectories to get other common folders where application data is stored.

Frank Carr  Thursday, December 14, 2006 10:49 PM

You can use google to search for other answers

Custom Search

More Threads

• How to create shorcut in a Setup Project
• Defining custom permissions for ClickOnce
• Difference between using publish.htm and the .exe?
• [MSI] DIRCA_CheckFX fails on some PC
• Using a program created in vb.net on another computer
• Uninstall custom action
• Click Once Problem
• Installer to check Windows version
• Conditionally Deploy Merge Modules
• Windows Form hosted in IE with 3rd Party Controls