Search code examples
c#.netdatabasems-accessoledb

Access data load failing in .net


I have a .net application that is not working on a colleagues computer (he works remotely so it's harder to diagnose the problem). The error appears when data is being loaded from an Access database. Here is the code I'm using to load the data:

var constring = @"Provider=Microsoft.JET.OLEDB.4.0;Data Source=X:\db.mdb";
OleDbConnection c = new OleDbConnection(constring);
c.Open();
var dataSet = new DataSet();
var adapter = new OleDbDataAdapter("SELECT * FROM Table", c);
adapter.Fill(dataSet);
c.Close();

What can cause an error at this stage? Will this code break if Access isn't installed, or the wrong version? What other things could cause this code to break?

Edit: Not C:\, but X:\, which is a shared network drive.


Solution

  • At first glance; - there is no provider in the machine - there is no source file C:\db.mdb - source file (database) is not proper (no table name Table)