-1

I am using Oledb connection for database connectivity but i am getting error be sure i am not using SQL server i am using Microsoft access 2013

I am using Oledb connection for database connectivity but i am getting error be sure i am not using SQL server i am using Microsoft access 2013

Khawar Islam
  • 2,556
  • 2
  • 34
  • 56
  • 2
    What is your connection string _exactly_? – Soner Gönül Feb 14 '16 at 17:21
  • Look at your app.config file, search for a line with ConnectionString matching the key you have used in the program to retrieve the connection settings and show that line to us. It is probably wrong – Steve Feb 14 '16 at 17:24
  • That string is invalid for MS-Access, take a look here [www.connectionstrings.com/access](http://www.connectionstrings.com/access/) – Steve Feb 14 '16 at 17:30
  • Provider=Microsoft.ACE.OLEDB.12.0; when i put this code in app.config file this also give an error the Provider Name is not allowed – Khawar Islam Feb 14 '16 at 17:35
  • The oledb connection with access database is possible only for 32bit application, check if your project is running x86 (Look at project properties). If you don't have oledb12 you may try with "Microsoft.Jet.OLEDB.4.0" – bdn02 Feb 14 '16 at 19:26

1 Answers1

1

The Oledb connection string to use with Access should be like:

<add name="MYDBConnectionString" 
connectionString= "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=<path>\yourAccessFile.accdb" />

Make sure you have access database engine registered on your machine. Also install the correct 32 bit or 64 bit according to you system architecture.

vendettamit
  • 14,315
  • 2
  • 32
  • 54