0

I'm updating a C# (.NET 3.5) application to interact with an Access database, but I keep getting this error:

ERROR: Unrecognized database format

This is the code I'm using to open a connection to the database:

        String connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; " +
            "Data Source=" + filePath;

        try
        {
            this.conn = new OleDbConnection(connectionString);
            this.conn.Open();
        }
        catch (Exception e)
        {
            Console.WriteLine("ERROR: " + e.Message);
            Console.WriteLine(e.ToString());
        }

I know that the file path is correct. I suspect that the Provider=Microsoft.Jet.OLEDB.4.0; is incorrect. How do I find out what the database format is? I did not make the database in question, but I do have read-access to it. Thanks.

1

1 Answer 1

1

You must add Data Source , user/password parametters . You can see http://connectionstrings.com/access

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.