Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C#: Password protected DB connection

Options
  • 12-06-2006 4:29pm
    #1
    Registered Users Posts: 354 ✭✭


    I’m having trouble with a web application I’m trying to develop in c#. I can get everything working with an unsecured database but the problem arises when I try to use a password protected DB. I get the error:

    “Cannot start your application. The workgroup information file is missing or opened exclusively by another user.”

    Any tips or hints you could give me would be great.
    connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
                                                  Data Source=C:\Applications\MyApp.mdb;
                                                  User ID=a;
                                                  Password=b";
    
    	if( !IsPostBack )
    	{
    		connection.Open();
    		adapter = new OleDbDataAdapter("SELECT Productname AS Name, ProdDesc AS Description FROM Products WHERE Ordered=True", connection);
    		adapter.Fill(products, "Products");
    		DataGrid1.DataSource = Products.Tables["Products"].DefaultView;
    		DataGrid1.DataBind();
    		connection.Close();
    }
    


Comments

Advertisement