User991499041 posted
Hi SMDQVTMM,
After I changed provider in connection string as "Microsoft.ACE.OLEDB.12.0" . I got an error The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
When I debug in my local machine, it works. But After I published my project on the server, I got this error. Any help is appreciated.
Ensure that you change the application pool in IIS to enable 32-bit applications.

Here's a discussion about this error, please refer to it and let me know whether it is worked for you.
Solved - The Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine
https://www.mikesdotnetting.com/article/280/solved-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine
Regards,
zxj