SQL Connection 'Provider cannot be found'

TeDeSm
TeDeSm used Ask the Experts™
on
System.Runtime.InteropServices.COMException: 'Provider cannot be found. It may not be properly installed.'

I know that this issue appears regularly on various sites but it can be an annoyance when the answer isn't obvious.
I have a VB.Net project that connects to an Excel spreadsheet and also a SQL database. The Database is updated with data from one of the Excel columns.
My project runs on some Windows 7 and / or Windows 10 machines but not on others giving the message above. It does successfully run on a Windows 10 64bit. There is a mix of 32/64 bit clients machines and SQL2014 is on a 64 bit server.
Annoyingly, I cannot get the project to run on my newly built Windows 10 in VS 2017 15.9.11
Office version is 365 Pro Plus 1904 build 11601.20144
Project references ADODB ActiveX data Objects 2.8 Library, Office 16.0 Object Library, Excel 16.0 Object Library amongst others.
The connection string is:
<add name="FloydConnectionString" connectionString="Data Source=FLOSERVSQL\FLOSQL;Initial Catalog=FloydProgs;User Id=floydproguser;Password=xcxcxcx;" providerName="System.Data.SqlClient"/>

What can I look at to get the client machines to run this project?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Configure your projects' platform target from Any CPU to x86

Author

Commented:
Hi John, I have the Configuration = Release, Platform = X86, Target CPU = X86
Anything else?

Author

Commented:
Hi John, This is the exception:
System.Runtime.InteropServices.COMException
  HResult=0x800A0E7A
  Message=Provider cannot be found. It may not be properly installed.
  Source=ADODB
  StackTrace:
   at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
   at Floyd.StockItemUpdate.frmStockItemUpdate.btnUpdateStockItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at Floyd.StockItemUpdate.My.MyApplication.Main(String[] Args)
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
Hi John,
I found the problem. It was the connection to Excel that was failing.
I needed to install the 32bit Microsoft Access Database Engine 2010 Redistributable. It's not installed as part of the Office installation by default.
My old machine had the 2007 version but the 2010 version is OK. I had a look at trying to install the 2016 version but received a complaint that I had 64bit Office applications; curious as I had installed the 32bit version of Office and the 2010 32bit Redistributable version installed OK.

Author

Commented:
Traced the Office 64bit  application to 'Office 16 Click-to-Run Extensibility Component 64-bit Registration' which I uninstalled. Installed Microsoft Access Database Engine 2016 Redistributable 32bit and all is well again.

Author

Commented:
Thanks for the interest John

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial