Link to home
Start Free TrialLog in
Avatar of TeDeSm
TeDeSm

asked on

SQL Connection 'Provider cannot be found'

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?
Avatar of John_Vidmar
John_Vidmar
Flag of Canada image

Configure your projects' platform target from Any CPU to x86
Avatar of TeDeSm
TeDeSm

ASKER

Hi John, I have the Configuration = Release, Platform = X86, Target CPU = X86
Anything else?
Avatar of TeDeSm

ASKER

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)
ASKER CERTIFIED SOLUTION
Avatar of TeDeSm
TeDeSm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TeDeSm

ASKER

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.
Avatar of TeDeSm

ASKER

Thanks for the interest John