问题
I have an Access database (.accdb) and I have a WPF application trying to connect to it.
It seems that I don't have Microsoft.ACE.OLEDB.12.0; installed.
Results of:
OleDbEnumerator enumerator = new OleDbEnumerator();
var t = enumerator.GetElements();
var a = "s";
foreach (DataRow row in t.Rows)
{
Console.WriteLine(row[0]);
}
on x86 CPU Gives the following results
SQLOLEDB
MSDMine
MSDataShape
SQLNCLI11
ADsDSOObject
MSOLEDBSQL
MSOLEDBSQL Enumerator
MSDMine Enumerator
SQLNCLI11 Enumerator
Windows Search Data Source
MSOLAP
MSOLAP
MSDASQL
MSDASQL Enumerator
MSOLAP
MSOLAP
Microsoft.Jet.OLEDB.4.0
SQLOLEDB Enumerator
MSDAOSP
MSDAORA
and on 64 I get the following
SQLOLEDB
MSDataShape
SQLNCLI11
ADsDSOObject
MSOLEDBSQL
MSOLEDBSQL Enumerator
SQLNCLI11 Enumerator
Windows Search Data Source
MSDASQL
MSDASQL Enumerator
MSOLAP
MSOLAP
SQLOLEDB Enumerator
MSDAOSP
Now the problem I have is that I nor my users have admin privileges on our computers so installing a new driver is out of the question (So I can't use the free Microsoft.ACE.Oledb.12.0).
How do I go and deploy a WPF app that can connect to an access database (accdb not mdb) and does not require me or any user to install something that an admin has to walk behind and input their credentials?
At this point I'm willing to rewrite my application to make sure it works in 86 if there is a solution there.
Bad assumption: I think a user will have the same drivers installed as I have here.
Note: I have Excel VBA programs that can connect to the Access db so the driver exists somewhere I think.
来源:https://stackoverflow.com/questions/58103947/c-sharp-connecting-to-access-db-with-no-install