Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:50:51+00:00 2026-05-25T15:50:51+00:00

I am using access db which is in bin/debug folder and use it in

  • 0

I am using access db which is in bin/debug folder and use it in code like

    private static string **_strCon** = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + 
***Application.ExecutablePath.ToString().Substring(0, 
Application.ExecutablePath.ToString().LastIndexOf('\\')) +
 "\\Reporting.accdb***;Jet 

OLEDB:Database Password=abc;";

and for reports I use DataSet which is using connectionstring from app.config like

    <add name="GarzaReportingSystem.Properties.Settings.ReportingConnectionString" 

connectionString="Provider=Microsoft.ACE.OLEDB.12.0;***Data Source=|DataDirectory|\bin

\Debug\Reporting.accdb***;Persist Security Info=True;Jet OLEDB:Database Password=abc" providerName="System.Data.OleDb"/>

PROBLEM:

When I make setup of the project and than install the application. I need to put Reporting.accdb in root folder in order for my forms to work using _strCon. In Other words my Executable path becomes root folder

But for DataSet

I need to put access db in bin/debug folder for it to work when application is installed.

How to solve this problem so both resolve same path like root has folder DataBase and both use that path.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:50:52+00:00Added an answer on May 25, 2026 at 3:50 pm

    You should not deploy a DB in your installation directory: Write access in C:\Program Files and subdirs requires Admin privileges. You should better copy it in your directory under ProgramData.

    Better yet, if you want different Windows users to have their own copy of the DB: When your program starts, it should look for a copy of the DB in current user’s AppData folder. If there’s no copy available, your program should first copy the file from \Program Files\blah\ to user’s AppData.

    Answers to this question show how to retrieve the AppData path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using this code to launch a Wpf form: string fileName = @C:\Test\bin\Debug\WpfTest.exe;
There are some text files(Records) which i need to access using C#.Net. But the
Background info : I was handed a Tool, which was made using MS-Access 2007,
I'm using bzr to access a Subversion repository. Which is great, but the repository
I'm displaying user messages through templates using RequestContext in Django, which gives access to
I am using a machine on which I do not have root access and
Using DTS I'm dynamically creating an access database. After the file is created (which
I am using Squeeze Box to access a PHP file which prints an alert
I have an MVC-based site, which is using a Repository/Service pattern for data access.
A site I use displays a flash file, which is embedded dynamically using SWFObject.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.