我需要幫助! 我想有微軟存取權限2013年和我的windows窗體之間的連接,它不工作,我不知道爲什麼,這是我的代碼:Ms Access2013與windows窗體c#(oledb)之間的連接
private void Form1_Load(object sender, EventArgs e)
{
OleDbConnection cnn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.15.0;Data Source= C:\\Users\\NIZAR\\Documents\\Visual Studio 2010\\Projects\\C#\\testConnBD1\\testConnBD1\\madb1.accdb");
try
{
cnn.Open();
MessageBox.Show("Connection Open ! ");
cnn.Close();
}
catch
{
MessageBox.Show("Can not open connection ! ");
}
}
你得到什麼錯誤信息? – Avijit
用catch(Exception ex){MessageBox.Show(ex.Message); }'並告訴我們顯示的錯誤消息 – Steve
我的猜測是正在使用的體系結構需要設置爲x86:http://stackoverflow.com/questions/13879789/x64-application-accessing-mdb-database –