Connecting to an Access 2000 database
I have been using the following code successfully to connect to an Access 98 database (? - it is the Northwind database on Microsoft's website and it is pre-2000):
OleDbConnection oleDbConn = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Nwind.mdb; ");
OleDbDataAdapter dAdapt = new OleDbDataAdapter("SELECT ContactName FROM Customers", oleDbConn);
DataSet ds = new DataSet("Customers");
Console.WriteLine("" + e.Message);
For some reason if I convert the database to Access 2000, this code no longer works. When I invoke the web service no data is collected and it complains that the database is locked exclusively by another user (which is not true) or that I don't have permission to view the data.
I have tried adding the parameters:
User ID=Admin; Password=
in the connection string but this does not help.
I am running Windows XP Pro, and using MS Visual C# .NET.
Any help or suggestions are very much appreciated!