Connecting to Access Database

Discussion in 'Databases' started by shaolin, Jul 17, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Can anyone tell me how to connect to the Access database using C# code. Currently, I am doing something like this...

    System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
    conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=/../_database/db1.mdb;" +
    "User ID=userid;" + "Password=password";

    What am I doing wrong?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    did you get an error?


    quote:Originally posted by shaolin

    Can anyone tell me how to connect to the Access database using C# code. Currently, I am doing something like this...

    System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
    conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=/../_database/db1.mdb;" +
    "User ID=userid;" + "Password=password";

    What am I doing wrong?
    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page