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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:50:50+00:00 2026-06-18T23:50:50+00:00

I have a C# 2010 WinForms application, running on .Net Framework 3.5. This application,

  • 0

I have a C# 2010 WinForms application, running on .Net Framework 3.5. This application, when launched, connects to an Access 2007 accdb database which is located in the same folder as the executable. Here is the code used to connect:

    public static OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=LineWatchManager.accdb;Persist Security Info=True;Jet OLEDB:Database Password=<password here>");
    public static void CreateConnection()
    {
        con.Open();
    }

The problem I am having is that on the client’s computers (Windows 7), the first time the program is launched after starting the computer, the connection to the database always fails. After that, it connects without any problems.

I have tried to get the program to attempt to connect 3 times to the database when it starts, but this does not help, even with 500 ms between attempts. I do not have this problem on my computer (either Windows 7 or 8).

After a lot of debugging attempts and many hours spent online, the only related article I found is this. Sadly no solutions in it, but since this has happened to someone not using Access, I’m guessing it’s either .Net’s fault or C#’s. Any help would be greatly appreciated!

EDIT: The client is not running the complete version of Access but this runtime.

  • 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-06-18T23:50:51+00:00Added an answer on June 18, 2026 at 11:50 pm

    Try this connectionString, notice the |DataDirectory| this will be the default path of your application.

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|/LineWatchManager.accdb;Persist Security Info=True;Jet OLEDB:Database Password=<password here>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# 2010 WinForms application using .Net Framework 4. I am using
I have a VB.NET 2010 Winforms application where I'd like to include line numbers
I have published a WinForms application from Visual Studio 2010. It uses .NET 4.0.
I have developed a WinForm Application with VB.Net (VS2010) having Office 2010 Professional Installed,
I have a WinForms app built with VB.Net in VS 2010, and I'm scratching
I have a .NET WinForms application that I've converted into a COM dll using
I have a C# WinForms application in Visual Studio 2010 that is used by
Our environment: Visual Studio 2010, c#, .net 4 client profile. We have a Winforms
I have created a WinForms application using C# 2010. It contains a report created
So I have this MS-Access database with a couple of tables. I'm filling a

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.