0

Everything is perfect in this connection string according to my knowledge.But its not working fine.I'll be very thankful if someone helps me out to sort out this issue.Thanks

   string constr = "**Provider=Microsoft.ACE.OLEDB.4.0; Data Source=Data Source=F:/Database1.accdb;Persist Security Info=False**"; 
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(constr);

2
  • Data Source=Data Source=F:/Database1.accdb <= Data Source=F:\Database1.accdb Commented Oct 28, 2013 at 11:41
  • still its not working... "F:\" is throwing error. Commented Oct 28, 2013 at 11:52

1 Answer 1

1

Your current connection string has multiple issues. Try this instead:

string constr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Database1.accdb;Persist Security Info=False"; 
Sign up to request clarification or add additional context in comments.

7 Comments

still it is giving error.." microsoft.ace.oledb.12.0' provider is not registered on the local machine c#".. i have installed it but still its giving same error..
@user2927881 It sounds like the version you installed does not match the "bitness" of your application. For example, if you are running a 64-bit application then you need the 64-bit version of the Access Database Engine.
"64-bit version of the Access Database Engine" was missing..i have installed it but now when i try to add its .DLL . Error is poping up and system is not letting me to add this refrence.how it can be sorted out???
On 64-bit versions of Windows look for the below paths: 64-bit - "C:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL" i am trying to add this refrence..but its giving error...
its working now..by clicking on option of AnyCpu..Thanks a lot for your response..
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.