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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:34:09+00:00 2026-05-30T20:34:09+00:00

The connection always times out without generating an error message even though it is

  • 0

The connection always times out without generating an error message even though it is within trycatch. I suspect there is something wrong with the connection string. This is what I currently have:

            string path = @"C:\PATH\TO\wantedDB.mdb";

            if (!File.Exists(path))
                throw new FileNotFoundException("File not found.");
            else
                Console.WriteLine("File found."); // File is found, so nothing wrong with that.

            string connectionstring = "Database=wantedDB;AttachDBFilename=" +
            path + ";Server=(local)";

            using (SqlConnection conn = new SqlConnection(connectionstring))
            {
                Console.WriteLine("Opening connection...");
                conn.Open();
                Console.WriteLine("Connection opened."); // Program never gets here.

I have also tried a relational path in connection string like:

string connectionstring = "Database=wantedDB;AttachDBFilename=\"wantedDB.mdb\";Server=(local)";

The db is not protected by a password. I have MS Access installed, does that affect this somehow? What am I missing?

  • 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-30T20:34:10+00:00Added an answer on May 30, 2026 at 8:34 pm

    To connect to a mdb file you should use the OLEDB connector:

    var con = new OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0;" + "data source=C:\\wantedDB.mdb;");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In all MVC Diagrams i've seen, there is always a connection between the View
I keep a JMS connection always open, because I have a MessageListener on it.
From my understanding the XMPP protocol is based on an always-on connection where you
I've always wanted a way to make a socket connection to a server and
Connection.close() may throw SqlException , but I have always assumed that it is safe
Should you always close a DataReader before closing the connection, or is it okay
Is keeping JMS connections / sessions / consumer always open a bad practice? Code
I was always connecting to SQL which was simple, but now I would need
Do you always follow the convention of putting branches, tags and trunk directories at
MySQL connection in PHP can be established in two ways: $mysql = new mysqli('localhost',

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.