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 771939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:43:59+00:00 2026-05-14T18:43:59+00:00

I want my connection to the database to be available all the time, so

  • 0

I want my connection to the database to be available all the time, so if i move the folder with the project, to an other computer, the connection to be made automaticaly.
So, how can i change this connection:

this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"C:\\Documents and Settings\\Cristi\\Do" +
                "cuments\\Visual Studio 2008\\Projects\\WindowsApplication3\\bd1.mdb\"";

???
It should read the project directory or something. I don’t know. Any ideas?
Thank You!

  • 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-14T18:43:59+00:00Added an answer on May 14, 2026 at 6:43 pm

    If you add the access database to the project, and in the file properties set the Copy to Output Directory property to Copy Always (or Copy if Newer if appropriate), you can use a connection string similar to this:

    this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\".\\bd1.mdb\""; 
    

    This will work because the database will be located in the same folder as your binaries.

    Similarly, you could use a relative path to your database, relative to where the executing assembly is located.

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

Sidebar

Related Questions

I want my code to automatically try multiple ways to create a database connection.
Say I have a connection to a database. After reading some stuff I want
I want to establish a connection between my local machine and MySQL database server
I want to access a MySQL database from Java, but remote connection is disabled
I have an Oracle Connection to a ORACLE 10.2 database and want to listen
I want to try db connection to check is db available. In zend I
If we want to implement a resource pool such as a database connection pool.
I want to make a single database object available across many python modules. For
How to prevent a race condition in MySQL database when two connections want to
i want to practice connecting from asp.net to a sql server database. i have

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.