c# - Accessing mdb file in wpf application -


we're using access file .mdb file in our wpf project, , file created in between ms access 97.

it giving exception "cannot open database ''. may not database application recognizes, or file may corrupt."

but it's not giving exception while calling queries using adapters like:

tblaccounttableadapter accountadapter = new tblaccounttableadapter();             datetime? syskey = accountadapter.getsyskeyofaccount(accountnumber); 

connection string:

provider=microsoft.jet.oledb.4.0;data source=|datadirectory|\data\mmlp.mdb;persist security info=true 

from above query while calling 'getsyskeyofaccount()' it's giving above exception , giving query not sticking 1 query give exception.

and tried many times find issue , it's hard find it's giving exceptions in different places.

and file kb in size, can 1 me out.

thanks, nag

depending on machine running on , version of mdb trying connect to, might better using ace drivers (or may, choice)

the jet 4.0 drivers enable read office formats , including office 2003. office 2007 , above, need use ace drivers

there no 64 bit jet drivers, might reason why you're unable connected using jet.

there are, however, both 32 , 64 bit ace drivers , backwards compatible

the driver available here: microsoft access database engine 2010 redistributable

the connection string(s) use detailed here: connection strings access 2007


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -