I am having a problem figuring out MS Access connections string. As per this question , I set up my connection definitions to:
<add key="CONNECTION_PROVIDER" value="Microsoft.ACE.OLEDB.12.0" />
<add key="CONNECTION_STRING" value="Data Source = C:\Users\me\Documents\FareReconciliation.accdb;Persist Security Info=False;" />
Petapoco returns Server not found
error. I have Office 2016 Pro Installed. I tried to download the the Access Runtime but it says one one product may be installed once. I can open the FareReconciliation.accdb file in Access. This is an old file. what should be my CONNECTION_PROVIDER
? Is it based on what version of Access I have or which Access Version that the Database originally created?
Remember, this is an old Access Db. How do I find the actual Runtime Version or whatever (if necessary)?
Assuming you are connecting to Access using .NET...
Define your connection string in the *.config file follows:
<connectionStrings>
<add name="CONNECTION_STRING" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;;Data Source=C:\Users\me\Documents\FareReconciliation.accdb;Persist Security Info=False;" />
</connectionStrings>
In code (VB in this example) reference the connection string as follows:
Var connString As String = Configuration.ConfigurationManager.ConnectionStrings("CONNECTION_STRING").ConnectionString
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.