I recently upgraded from SQL Server 2017 Express to SQL Server 2019 Express and installed Microsoft SQL Server ODBC Driver 18. However, a sqlcmd script to back up all databases, using Ola Hallengren's maintenance solution, still wants to use Microsoft ODBC Driver 17. I uninstalled Microsoft ODBC Driver 17 for SQL Server. Now I am getting the below error when I run the script in a .cmd file via the Windows Task Manager.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Data source name not found and no default driver specified.
How can I get sqlcmd to use the Microsoft SQL Server ODBC Driver 18?