Click here to Skip to main content
15,921,382 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
To import a .txt Tab delimited file for that I used Provider=Microsoft.ACE.OLEDB.12.0, but when I run my project I get this error
"The Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

I install AccessDataBaseEngineX64 file, but still getting error. Error getting me in Con.open() line.i am appyling all solutions but still getting same error plz read carefully and give me the solution. and my Configuration is WINDOWS 10 64 bit and Day before yesterday i install WINDOWS 10.


What I have tried:

public void ImportTxtFile(string filename)
    {
        FileInfo file = new FileInfo(filename);
        string path = @"E:\\TxtFile";
        using (OleDbConnection con =
        new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + @";Extended Properties='text;HDR=YES;FMT=TabDelimited';"))
        {
            using (OleDbCommand cmd = new OleDbCommand(string.Format
            ("SELECT * FROM [{0}]", file.Name), con))
            {
                con.Open();
Posted
Updated 10-Aug-17 22:15pm

Check two things:
1) Is your app compiled for x86 or x64? If it's compiled for x86, then you can't access 64 bit Access drivers (or any other 64 bit code).
2) Check the version of the ACE engine you installed: V12 relates to the Office 2007 version, V14 is Office 2010. Your connection string specifically references teh 2007 version.
This may help: Simple SQL Connection String Creation[^]
 
Share this answer
 
Comments
Member 11729944 5-Oct-17 7:49am    
hii Griff,
Actually All settings are perfect the problem occured in Visualstudio 2017..the solution is:-Go to Tools Option of VS17==>Options==>Projects And Solutions==>Web Projects==>click the check box of "Use 64 bit version of IIS Express".
Check Control Panel -> Programs to see that you have "Microsoft Office Access database engine" installed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900