Hi,
Welcome to the Microsoft Q&A (Preview) platform. Happy to answer your question.
Looks like you're using SQLOLEDB in your ODBC SQL Connection method. The previous Microsoft OLE DB Provider for SQL Server (SQLOLEDB) and SQL Server Native Client OLE DB provider (SQLNCLI) remains deprecated and it is not recommended to use for new development work. You need to use OLE DB Driver for SQL Server.
The OLE DB Driver for SQL Server is a stand-alone data access application programming interface (API), used for OLE DB, that was introduced in SQL Server 2005 (9.x). OLE DB Driver for SQL Server delivers the SQL OLE DB driver in one dynamic-link library (DLL). It also provides new functionality above and beyond that supplied by the Windows Data Access Components (Windows DAC, formerly Microsoft Data Access Components, or MDAC). The OLE DB Driver for SQL Server can be used to create new applications or enhance existing applications that need to take advantage of features introduced in SQL Server 2005 (9.x), such as multiple active result sets (MARS), user-defined data types (UDT), query notifications, snapshot isolation, and XML data type support.
You can download Microsoft OLE DB Driver for SQL Server here.
Also, please update your .Net framework to the latest version(4.8).
Hope that helps,
Grace